c++ - Arrays cannot be half of a number -


an array cannot have declarated size of half right? isn't possible correct?

 arraya[1.5]; 

your understanding correct:

8.3.4 arrays
in declaration t d d has form d1 [constant-expression opt ] , type of identifier in declaration t d1 “derived-declarator-type-list t,” type of identifier of d array type. t called array element type; type shall not reference type, (possibly cv-qualified) type void, function type or abstract class type. if constant-expression (5.19) present, shall integral constant expression , value shall greater zero.

(international standard iso/iec 14882 second edition 2003-10-15, emphasis added)


Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -