Top

Discussion

What is the size of myArray in the code shown below? (Assume that 1 character occupies 1 byte)

typedef char x[10];
x myArray[5];

 

  • A.5 bytes
  • B.10 bytes
  • C.40 bytes
  • D.50 bytes

Answer: D

The size of myArray will be equal to 50 bytes. In the code shown above, we have defined a character array x, of size 10. Hence the output of the code shown above is 10*5 = 50 bytes.

No comment is present. Be the first to comment.
Loading…

Post your comment