Govt Exams
sizeof(int) * 10 = 4 * 10 = 40 bytes on a 32-bit system.
free() is the standard function to deallocate memory previously allocated by malloc(), calloc(), or realloc().
calloc() takes two arguments (number of elements and size) and initializes all allocated bytes to zero, unlike malloc().
The <stdlib.h> header file contains declarations for malloc(), calloc(), realloc(), and free() functions.
malloc() returns a void pointer (void*) that can be cast to any pointer type.
malloc() is the standard C function for dynamic memory allocation. It returns a void pointer to the allocated memory.
'w' opens file in text mode (converts line endings), while 'wb' opens in binary mode (no conversion). This matters when handling platform-specific line endings (\r\n vs \n).
feof() is the standard C library function that returns non-zero if EOF has been reached on the given file stream. Other options are not valid C functions.
'w' mode opens file in text format for writing. 'wb' is binary write. 'wt' is explicitly text write but 'w' is default text mode.
ftell() returns the current file position as a long integer. fgetpos() stores position in a fpos_t structure. rewind() resets to beginning.