What is wrong with this initialization?

Q

What's wrong with this initialization?
char *p = malloc(10);
My compiler is complaining about an ``invalid initializer'', or something.

✍: Guest

A

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).

2016-06-03, 859👍, 0💬