?
int
. , 16 , int
2 . 4 32-, 64- .
int
cout << sizeof(int);
: sizeof (int) = 4 .
?
int array[10];
40 BYTES ( ).
?
9 (1-9), 36 40 4 . . , 3- .
:
int array[100][100][100]
As a result, you will lose a lot of memory. I mean a lot of memory, which another process requires, but cannot use only because you intentionally reserved it and did not use it.
The problem with the lines.
If you work with arrays of characters, you can land something in a disaster.
Example:
char str[8];
str[1] = 'H';
str[2] = 'e';
str[3] = 'l';
str[4] = 'l';
str[5] = 'o';
str[6] = '\0';
cout<<str;
There may be a situation where the output will not be displayed, because it str[0]
may contain a character NULL
.
source
share