C Programming Question and Answers

41. What are preprocessor directives?
 
  • Preprocessor directives are placed at the beginning of every C program.
  • This is where library files are specified, which would depend on what functions are to be used n the program.
  • Another use of preprocessor directives is the declaration of constants. Preprocessor directives began with the # symbol.
 
Your Name Your Email-ID
Your Answer
42. What is the use of auto keyword?
  When a certain variable is declared with the keyword auto and initialized to a certain value, then within the scope of the variable. It is reinitialized upon being called repeatedly.
The keyword auto is used extremely rate. A variable is set by default to auto. The declarations auto int number, and int number.
 
Your Name Your Email-ID
Your Answer
43. What is the purpose of register keyword?
  It is used to make the computation faster. The register keyword tells the compiler to store the variable onto the CPU register if space on the register is available. However, this a very old technique. Today's processors are smart enough to assign the registers themselves and hence using the register keywords can actually slowdown the operations if the usage is incorrect.
The keyword register instructs the compiler to persist the variable that is being declared in a CPU registers.
 
Your Name Your Email-ID
Your Answer
44. What is the difference between null and zero?
 
  • NULL is a macro which is defined in Cheaderfiles. The value of NULLmacrois0. 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 *) o. it should not b used other than pointers. If NULL is assigned to a pointer, then pointer is pointing to nothing.
    0 (zero) is a value.
 
Your Name Your Email-ID
Your Answer
123456789101112


131415 Page 11 of 15