Govt Exams
The C standard does not specify the order of evaluation of function arguments. The order is implementation-dependent and can vary between compilers.
Variadic functions (using ...) don't validate argument count. Calling with fewer arguments leads to undefined behavior as the function reads undefined values from stack.
int x = 10;
int* getAddress() { return &x; }
main() { int *ptr = getAddress(); printf("%d", *ptr); }
Since x is static (global scope), returning its address is safe and the pointer remains valid. The output is 10. If x were local, it would be undefined behavior.
The restrict keyword (C99) is a promise to the compiler that the pointer is the only way to access that memory during its lifetime, allowing aggressive optimizations.
Passing large structures by pointer is more efficient as only address (typically 4-8 bytes) is copied, not entire structure.
C99 allows function declarations within blocks; they have scope limited to that block. This is different from function definitions which remain at file scope.
The syntax (*funcPtr) indicates funcPtr is a pointer. It points to functions taking two ints and returning int.
C doesn't support multiple return values. Both pointers (call-by-reference) and structs are valid techniques.
For mutual recursion, you need forward declaration (prototype) of at least one function before it's called by another.
Without base case, recursion never stops, causing stack to overflow as return addresses keep accumulating.