Wednesday, February 25, 2009

Which of the following is evaluated first:

a) &&
b) ||
c) !
d) *

Tuesday, February 24, 2009

Thursday, February 19, 2009

A multidimensional array can be expressed in terms of

a. Array of pointers rather than as pointers to a group of contiguous array
b. Array without the group of contiguous array
c. Data type arrays
d. None of these

Wednesday, February 11, 2009

Why does a pointer definition need a type to be specified?

Choice a : To specify the size of the pointer
Choice b : To clear the memory being pointed to before it is assigned
Choice c : To set the endianness of the pointer
Choice d : To set the address space definition
Choice e : To allow pointer math to work properly

If a machine uses some nonzero internal bit pattern for null pointers, how should the NULL macro be defined?

Answer: As 0 (or (char *)0), as usual. The *compiler* is responsible for translating null pointer constants into internal null pointer representations, not the
preprocessor.

Monday, February 9, 2009

What is sizeof('A') ?

The same as sizeof(int). Character constants have type int in C. (This is one area in which C++ differs.)

Thursday, February 5, 2009

Which one of the following operators has right to left associativity?

Choice a: Function call operator ()
Choice b: Logical not operator !
Choice c: Array index operator []
Choice d: Multiplication operator *
Choice e: Pointer operator ->