Basic and Advance C Question:
Download Job Interview Questions and Answers PDF
What is wrong with this initialization?
Answer:
What's wrong with this initialization?
char *p = malloc(10);
My compiler is complaining about an ``invalid initializer'', or something.
Is the declaration of a static or non-local variable? Function calls are allowed in initializers only for automatic variables (that is, for local, non-static variables).
char *p = malloc(10);
My compiler is complaining about an ``invalid initializer'', or something.
Is the declaration of a static or non-local variable? Function calls are allowed in initializers only for automatic variables (that is, for local, non-static variables).
Download C Programming Interview Questions And Answers
PDF
Previous Question | Next Question |
How can I dynamically allocate arrays? | How can this be legal C? |