Bhanu Priya has Published 1581 Articles

What is Realloc in C language?

Bhanu Priya

Bhanu Priya

Updated on 17-Mar-2021 10:38:43

528 Views

The C library memory allocation function void *realloc(void *ptr, size_t size) attempts to resize the memory block pointed to by ptr that was previously allocated with a call to malloc or calloc.Memory allocation FunctionsMemory can be allocated in two ways as explained below −Once memory is allocated at compile time, ... Read More

What is Calloc in C language?

Bhanu Priya

Bhanu Priya

Updated on 17-Mar-2021 10:37:07

553 Views

The C library memory allocation function void *calloc(size_t nitems, size_t size) allocates the requested memory and returns a pointer to it.The difference in malloc and calloc is that malloc does not set the memory to zero, whereas, calloc sets the allocated memory to zero.Memory allocation FunctionsMemory can be allocated in ... Read More

What is malloc in C language?

Bhanu Priya

Bhanu Priya

Updated on 17-Mar-2021 10:34:28

5K+ Views

The C library memory allocation function void *malloc(size_t size) allocates the requested memory and returns a pointer to it.Memory allocation FunctionsMemory can be allocated in two ways as explained below −Once memory is allocated at compile time, it cannot be changed during execution. There will be a problem of either ... Read More

What is void pointer in C language?

Bhanu Priya

Bhanu Priya

Updated on 17-Mar-2021 10:33:07

664 Views

It is a pointer that can hold the address of any datatype variable (or) can point to any datatype variable.DeclarationThe declaration for void pointer is as follows −void *pointername;For example − void *vp;Accessing − Type cast operator is used for accessing the value of a variable through its pointer.SyntaxThe syntax ... Read More

Explain array of pointers in C programming language

Bhanu Priya

Bhanu Priya

Updated on 17-Mar-2021 10:30:47

13K+ Views

Pointer is a variable that stores the address of another variable.FeaturesPointer saves the memory space.Execution time of pointer is faster because of direct access to memory location.With the help of pointers, the memory is accessed efficiently, i.e., memory is allocated and deallocated dynamically.Pointers are used with data structures.Pointer declaration and ... Read More

Explain pointers and two-dimensional array in C language

Bhanu Priya

Bhanu Priya

Updated on 17-Mar-2021 10:23:57

5K+ Views

Pointer is a variable that stores the address of another variable.FeaturesPointer saves the memory space.Execution time of pointer is faster because of direct access to memory location.With the help of pointers, the memory is accessed efficiently, i.e., memory is allocated and deallocated dynamically.Pointers are used with data structures.Pointers and two ... Read More

Explain pointers and one-dimensional array in C language

Bhanu Priya

Bhanu Priya

Updated on 17-Mar-2021 10:21:38

6K+ Views

Pointer is a variable that stores the address of another variable.FeaturesThe features of pointer are explained below −Pointer saves the memory space.Execution time of pointer is faster because of direct access to the memory location.With the help of pointers, the memory is accessed efficiently, i.e., memory is allocated and deallocated ... Read More

How to send individual elements as an argument in C language?

Bhanu Priya

Bhanu Priya

Updated on 17-Mar-2021 10:02:07

125 Views

The array is a group of related items that is stored with a common name.Declaring arrayThe syntax used for declaring an array is as follows −datatype array_name [size];InitializationAn array can be initialized in two ways, which are as follows −Compile time initializationRuntime initializationAn array can also be initialized at the ... Read More

How to send an entire array as an argument in C language?

Bhanu Priya

Bhanu Priya

Updated on 17-Mar-2021 10:00:40

218 Views

An array is a group of related items that is stored with a common name.Declaring arrayThe syntax for declaring an array is as follows −datatype array_name [size];InitializationAn array can be initialized in two ways, which are as follows −Compile time initialization.Runtime initialization.An array can also be initialized at the time ... Read More

Explain scope rules related to the functions in C language

Bhanu Priya

Bhanu Priya

Updated on 15-Mar-2021 15:22:35

440 Views

Scope rules are related to the following factors −Accessibility of a variables.Period of existence of a variable.Boundary of usage of variables.Scope rules related to functions are as followsFunction which is a self-contained block that performs a particular task.Variables that are declared within the function body are called local variables.These variables ... Read More

Advertisements