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

Discussion

Which of the following is not accepted in C?

  • A.static a = 10; //static as
  • B.static int func (int); //parameter as static
  • C.static static int a; //a static variable prefixed with static
  • D.All of the mentioned

Answer: C

Correct answer: static static int a; //a static variable prefixed with static

A storage class specifier may appear only once in a declaration, so static static is rejected. The other two are legal: static a = 10; relies on the old implicit int, and static int func(int); declares a function with internal linkage.

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

Post your comment

Please log in or register to post a comment.