0
why is the answer 100 in the following code ? Please help me out !
#include <iostream> using namespace std; int main() { int numbers[100]; cout << sizeof(numbers) / sizeof(numbers[0]); return 0; }
2 Respuestas
+ 10
sizeof of an int = 4 bytes, you have an array of 100 ints so you have 400 bytes total, divided by sizeof of one int which 4. 400/4=100.
0
thanks