ptr[2] is equivalent to *(ptr+2), which dereferences the pointer and returns the value at the third element (index 2).
The pre-increment operator (++x) increments x from 5 to 6 before using its value in printf(). So the output is 6.
To explicitly declare a function with no parameters in C, use 'void' as the parameter. int func(); is ambiguous in older C standards.
#define is a preprocessor directive used to define symbolic constants (macros) and performs text substitution before compilation.
The arrow operator (->) is used to access structure members through a pointer. The dot operator (.) is used for direct access.
The break statement immediately terminates the loop and transfers control to the statement following the loop.
In C, if a function's return type is not explicitly specified, it defaults to int. However, modern C standards require explicit return type declaration.
Arrays in C are declared with square brackets containing the size, followed by initialization in curly braces. Option A is the correct syntax.
malloc() (memory allocation) allocates a block of memory dynamically during program execution and returns a pointer to it.
A pointer is a variable that stores the memory address of another variable. It is declared using the * symbol.