c++ - Initializing an Array using Size of Operator? -


i have array initialize

char arr[sizeof(int)]; 

would expression evaluate compile time constant or result in function call?

char arr[sizeof(int)]; 

as far language concerned, fine, though array declared (and defined), not initialized if local variable. if declared @ namespace level, statically zero-initialized.

note sizeof(int) constant expression of size_t type; value known @ compile time.


Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

jquery - How would i go about shortening this code? And to cancel the previous click on click of new section? -