Machine-translated by Google. Questions are authored in English.
Top

Discussion

Which of the following is not a pointer declaration?

  • A.char a[10];
  • B.char a[] = {’1', ’2', ’3', ’4'};
  • C.char *str;
  • D.char a;

Answer: D

Correct answer: char a;

An array name decays to a pointer to its first element in nearly every context, so the first two declarations yield something usable as a pointer, and char *str is one outright. A plain char holds a single character and has no pointer nature at all.

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

Post your comment

Please log in or register to post a comment.