Govt Exams
Both forms are valid. Functions decay to function pointers, so both &printf and printf assign the function address correctly.
void func() { func(); } int main() { func(); }
This is infinite recursion with no base case, causing stack overflow as the function keeps calling itself.
Functions can have multiple forward declarations but only one definition. This allows function prototypes in header files.
A callback function is a function pointer passed to another function, which calls it at a later point in time.
Without an explicit return statement, the function returns whatever value is in the return register, which is undefined behavior.
A static function has file scope and cannot be accessed from other translation units, providing encapsulation.
Variadic functions require at least one named parameter before the ellipsis. Both options B and C follow the correct syntax.
void func(int arr[10]) { printf("%lu", sizeof(arr)); }
int main() { int a[10]; func(a); }
When arrays are passed to functions, they decay to pointers. sizeof(arr) returns the size of the pointer, not the array.
Old-style K&R C declarations don't perform argument checking, allowing calls with fewer arguments. Modern prototyped functions generate compiler errors.
The correct syntax for function pointer is return_type (*pointer_name)(parameter_types). Option A is correct.