Question-41. Which key word is used to perform unconditional branching ?
Answer- goto.
Question-42. What is a pointer to a function? Give the general syntax for the same ?
Answer- A pointer holding the reference of the function is called pointer to a function. In general it is declared as follows.
T (*fun_ptr) (T1,T2…); Where T is any date type.
Once fun_ptr refers a function the same can be invoked using the pointer as follows.
fun_ptr(); [Or] (*fun_ptr)();
Question-43. Explain the use of comma operator (,) ?
Answer- Comma operator can be used to separate two or more expressions.
Eg: printf(“hi”) , printf(“Hello”);
Question-44. What is a NULL statement ?
Answer- A null statement is no executable statements such as ; (semicolon).
Eg: int count = 0; while( ++count<=10 ) ;
Above does nothing 10 times.
Question-45. What is a static function ?
Answer- A function’s definition prefixed with static keyword is called as a static function. You would make a function static if it should be called only within the same source code.
Question-46. Which compiler switch to be used for compiling the programs using math library with gcc compiler ?
Answer- Opiton –lm to be used as > gcc –lm
Question-46. Which operator is used to continue the definition of macro in the next line ?
Answer- Backward slash (\) is used.
E.g. #define MESSAGE "Hi, \ Welcome to C"
Question-47. Which operator is used to receive the variable number of arguments for a function ?
Answer- Ellipses (…) is used for the same. A general function definition looks as follows
void f(int k,…) { }
Question-48. What is the problem with the following coding snippet ?
Answer-
char *s1 = "hello",*s2 = "welcome"; strcat(s1,s2);
s1 points to a string constant and cannot be altered.
Question-49. Which built-in library function can be used to re-size the allocated dynamic memory ?
Answer-realloc().
Question-50. Define an array ?
Answer- Array is collection of similar data items under a common name.