Akansha Kumari has Published 81 Articles

Address of a function in C or C++

Akansha Kumari

Akansha Kumari

Updated on 14-Jul-2025 17:24:15

3K+ Views

In C and C++, every function is stored in the computer's memory, and each function has a memory address just like all other variables. In this article, our task is to see how we can access the address of a function and display it in both C and C++. ... Read More

enum vs. const vs. #define in C/C++

Akansha Kumari

Akansha Kumari

Updated on 16-Jun-2025 17:23:14

710 Views

The #define, const, and Enum are all used for declaring constant values, but their behaviours and use cases differ. The #define is a preprocessor directive, which is used to define a macro (it is a string or name, in which you can assign a constant value), whereas const is a ... Read More

What are signed and unsigned keywords in C++?

Akansha Kumari

Akansha Kumari

Updated on 13-Jun-2025 12:53:05

2K+ Views

In C++, the keywords signed and unsigned are used to specify that a given variable can hold negative values or only positive values. In this article, we will learn the differences between these two in more detail. C++ signed Keyword The signed keyword specifies that the given variable can hold both ... Read More

When to use C over C++, and C++ over C?

Akansha Kumari

Akansha Kumari

Updated on 11-Jun-2025 18:10:20

1K+ Views

Both C and C++ are powerful programming languages that are used by developers to write both system-level and high-level programs. C language follows procedural programming paradigm with a simple and structured approach, whereas C++ supports both procedural and object-oriented programming. Although both C and C++ are widely used across various ... Read More

How to get the IP Address of local computer using C/C++?

Akansha Kumari

Akansha Kumari

Updated on 11-Jun-2025 18:01:43

9K+ Views

In this article, we will see how to get the Host name and IP address of the local system in an easier way using C and C++ program.  Getting IP Address of Local Computer For this, some standard networking functions are available in socket programming with header files like on ... Read More

Difference between C structures and C++ structures

Akansha Kumari

Akansha Kumari

Updated on 11-Jun-2025 17:54:19

4K+ Views

A structures (or struct) is a user-defined data type, which is used to group and store variables of different data types inside a single name. But in C, structures can store only data members whereas C++ can store member functions, constructors, destructors, and even inheritance which is similar to classes ... Read More

fdim() in C++

Akansha Kumari

Akansha Kumari

Updated on 10-Jun-2025 17:23:55

218 Views

C++ fdim() Function The fdim() function returns the positive difference between two floating-point values. For example, if we have two arguments, a and b, respectively, then it will return a-b if a > b, else it will return 0. This function is defined under or header files and supports ... Read More

Type difference of character literals in C and C++

Akansha Kumari

Akansha Kumari

Updated on 10-Jun-2025 17:17:06

698 Views

Character literals are those values, which are assigned to the variable of character data type. It is written as a single character enclosed in single quotes (' ') like 'A', 'b' or '2'. But if we see how these character literals are stored in memory, their type differs. In C ... Read More

Structure Sorting in C++

Akansha Kumari

Akansha Kumari

Updated on 09-Jun-2025 19:27:25

2K+ Views

A structure in C++ is a user-defined data type, which is used to group and store variables of different data types under a single name. In this article we will see how to sort an array of structures using conditions on member variables. For this we will be using the ... Read More

Difference between void main and int main in C/C++

Akansha Kumari

Akansha Kumari

Updated on 09-Jun-2025 15:28:49

37K+ Views

The main() function in C and C++ is anentry point of a program from where the execution begins. And there are two common ways available to define the main function; int main() and void main(). In this following article we will learn the differences between these two in detail. The ... Read More

Advertisements