File handling in C allows us to use our C program to create, update, read, and delete files stored on the local file system. A file can be subjected to the following operations: Making a new file Choosing an existing file to open Taking a page from the file Adding to the file removing the […]
April 3, 2022 | C | No comments
We can create a pointer pointing to a function in the same way that we can create a pointer of any data type, such as int , char, or float. A function’s code is always stored in memory, which implies that the function has an address. We use the function pointer to get the memory […]
April 2, 2022 | C | No comments
Just like any other data type, we can perform various arithmetic operations on pointers. All pointers int, float, long, and double are 2 bytes on a 16-bit machine. When we perform any arithmetic function, such as increment on a pointer, the size of their primitive data type changes. Remember the following data type storage sizes […]
April 2, 2022 | C | No comments
A pointer variable stores the address of another pointer variable; this is referred to as a pointer to a pointer variable in C. It is a type of multiple indirections, also known as a chain of pointers. A pointer contains the address of a variable, and when a pointer to a pointer is defined, the […]
March 31, 2022 | C | No comments
The structure pointer points to the memory block address where the Structure is stored. It’s used to make complex data structures like linked lists, trees, and graphs. The structure’s members can be accessed using an arrow operator (->). we can declare a struct pointer in the following manner: here, *p represents the pointer. Accessing is […]
March 28, 2022 | C | No comments
An array name is a constant pointer to the array’s first element. As a result, in the declaration marks is a pointer to &marks[0], which is the address of the array marks’s first element. As a result, the following program fragment assigns p as the address of the element of the first marks. After storing […]
March 27, 2022 | C | No comments
In C, a pointer is a variable that stores the address of another variable. This variable can be of any type, including int, char, array, function, or pointer. The pointer’s size is determined by the architecture. However, in 32-bit architecture, a pointer is 2 bytes in size. Pointer Notation Consider the declaration, This declaration tells […]
March 26, 2022 | C | No comments
A union is a particular data type in C that allows several data types to be stored in the same memory address. A union can have numerous members, but only one member can have value at any given time. Unions are a convenient approach to use the same memory region for numerous purposes. Both Structures […]
March 26, 2022 | C | No comments
Typedef in C is used to redefine the name of the existing variable type. It generally increases the readability and convenience of complex data types. Syntax: For instance, consider the following statement in which the type unsigned long int is redefined to be of the type TWOWORDS: Thus, typedef in C provides a short and […]
March 24, 2022 | C | No comments
C allows us to nest one structure within another structure, which allows us to design complicated data types. This type of structure is known as nested structure. For example, we may need to store the result of an entity student in a structure. The attribute result may also have the subparts like subject name, marks, […]
March 22, 2022 | C | No comments