releases memory from a linked list. Which of the following accurately describes how it will work?

a. It will work correctly since the for loop covers the entire list.
b. It may fail since each node nptr is freed before its next address can be accessed.
c. This is invalid syntax for freeing memory
d. The loop will never end

32. In C, what is the difference between a declaration and definition of a variable?

a. Both can occur multiple times, but a declaration must occur first.
b. Both can occur multiple times, but a definition must occur first.
c. A definition occurs once, but declaration may occur many times.
d. A declaration occurs once, but definition may occur many times.

58. Which one of the following describes the chief difference between a structure and a union?

a. The fields of a structure overlap each other in memory; the fields of a union are allocated sequentially.
b. The compiler pads structures for word alignment; the compiler allocates exactly enough space for a union to hold all of its fields.
c. A union may contain bitfields; a structure may not.
d. The fields of a structure exist concurrently; the fields of a union do not.

59. What would be the output of the following?

Code: C

int x=5;void print(){printf("%d",x--);}

main(){ print(x++);}

a. 4
b. 5
c. 6
d. None of the above

60. f = fopen( fileName, "r" );

Code: C

if( ???? ){ fprintf( stderr, "Could not open file!"); exit( -1); }

What should replace the ???? in the code above to determine if the file could NOT be opened?

I dont want to say whether answers are correct or not. Few questions are implementation dependant.Always you could execute and see and then try to find out reason behind the anwer. I feel that would be best way to learn

Why to be a spoiler. I thought that would just test my knowledge in C and would provide answers that are a bit confusing to those who do not know it? So to me it lot more useable than to those whom its spoiler.

Why to be a spoiler. I thought that would just test my knowledge in C and would provide answers that are a bit confusing to those who do not know it? So to me it lot more useable than to those whom its spoiler.