Govt Exams
int x = 10;
int *p = &x;
printf("%d", *p + 5);
*p dereferences pointer to get value 10, then 10+5=15 is printed.
Static variables retain their values between function calls and are initialized only once, maintaining state across invocations.
Signed char uses 8 bits with one bit for sign, giving range -128 to 127 (2^7 to 2^7-1).
On most 32-bit systems, float occupies 4 bytes (32 bits) of memory according to IEEE 754 standard.
restrict (C99) informs the compiler that a pointer is the sole accessor to the object, enabling optimization. It doesn't prevent modification.
The '*' applies only to the immediately following variable. So 'int *p' declares p as pointer to int, and 'q' is just an int.
%ld is for long int, %lld is for long long int, and %d is for regular int. Using wrong specifier can cause undefined behavior.
Uninitialized local variables contain garbage values (random data from memory). Static/global variables are initialized to 0 by default.
Initialization assigns a value when the variable is declared (int x = 5;). Assignment changes the value later (x = 10;).
When assigning a double to int, C performs implicit type conversion with truncation (not rounding). The decimal part is discarded.