C Interview Questions Part 1
C Interview Questions Part 1
*static variables
>retains the value between multiple calls
>scope of the static variable is available
throughout the program
>it is initially initialised with zero
*uses of functions
>avoid rewriting the same code again
>can be called any number of times
>provide reusability concept
>can be easily tracked
*recursion
>function calls itself
*pointers
>pointer is a variable that refers to the
address of a value
Uses of pointers
>accessing array elements
>dynamic memory allocation
>call by reference
>data structures like trees graphs
*null pointer:a pointer that doesn’t refer
to any address value
*the pointer points to the deallocated
memory is called dangling pointer
*static memory allocation
>memory is allocated at the compile
time
>faster then dynamic memory
*dynamic memory allocation
>memory is allocated at the runtime
>malloc()and calloc()functions are usd to
allocate memory at the runtime
>less memory space is required to store
the variables where as in static memory
allocation more memory space is
required
*dynamic memory allocation
>malloc()
>calloc()
>realloc()
>free()
*a loop running continuosly for an
indefinite number of times is called an
indefinite loop
*fopen() is used to open file
*fclose()is used to close the file
*type casting is the process of
converting one data type to another
>the maximum length of the identifier is
ideally 32 characters
>getch():reads the single character from
keyboard but it is not displayed on the
output screen
>getche():function reads the single
character from keyboard but data is
displayed on the output screen
>ANSI:American national standard
institute
>what is command line argument?
The argument passed to the main
function while executing the program
>what is a token??
>the token is an identifier .it can be
constant,keyword,string
literal,operators,special characters
*we can compile the program without
main feunction but we cannot run it
*sprint():does not print the output on
the console screen,it transfers data to
the buffer,it returns the total number of
characters present in the string
*the local variables are also known as
auto variables
*union is an user defined data type
*structure is an user defined datatype....