C Programming Question and Answers
73. | What is NULL in C? |
---|---|
NULL is a macro which defined in C header files. The value of NULL macro is 0. It is defined in C header files as below #define NULL (void *) 0; NULL is used for pointers only as it is defined as (void *) 0. It should not be used other than pointers. If NULL is assigned to a pointer, then pointer is pointing to nothing. |
|
74. | What is null pointer in C? |
---|---|
Null pointer is a pointer which is pointing to nothing. Null pointer points to empty location in memory. Value of null pointer is 0. We can make a pointer to point to null as below. int * p = NULL; char * p = NULL; | |
75. | What happens when the user gives a command to run a program? |
---|---|
The operating system first allocates the requisite amount of memory to the program, then, through loader, loads the program in the allocated memory, and then passes on the control to the program. The program runs the supervision of the operating system. When the program finishes its execution or some runtime errors occurs, the operating system removes the program from the memory. | |
76. | What is file pointer in C? |
---|---|
|
|