Govt Exams
fclose() is the standard function to close an opened file stream. It returns 0 on success and EOF on error.
'rb' mode opens a file for reading in binary format. Binary mode reads the exact bytes without any text conversion.
fopen() is the standard C library function used to open a file. It takes two arguments: filename and mode.
Passing a pointer to the structure avoids copying the entire structure in memory, which is especially important for large structures with array members. This improves performance significantly.
A self-referential structure contains a pointer to its own type. This is the fundamental building block for creating linked lists, trees, and other dynamic data structures.
In structures, memory is allocated for each member independently. In unions, all members share the same memory location, so total memory allocated equals the size of the largest member.
Self-referential structures contain pointers to their own type, enabling dynamic data structures like linked lists and trees.
A self-referential structure with a single pointer member is the fundamental building block of a singly linked list.
typedef creates an alias, allowing you to use the structure name directly without using 'struct' keyword.
Both (*ptr).member and ptr->member are valid. Option B uses explicit dereferencing, while the arrow operator is syntactic sugar for this.