| 1 | #include <iostream> |
| 2 | using namespace std; |
| 3 | int main() |
| 4 | { |
| 5 | int num_array1[5] = {0,1}; // fixed length array, initialized to {0,1,0,0,0} |
| 6 | cout << "sizeof(num_array1) = " << sizeof(num_array1) << endl; |
| 7 | |
| 8 | int len = 0; |
| 9 | while ( len < 10 ) |
| 10 | { |
| 11 | int num_array2[len]; //variable-length array |
| 12 | cout << "len = " << len; |
| 13 | cout << ", sizeof(num_array2)) = " << sizeof(num_array2) << endl; |
| 14 | len ++; |
| 15 | } |
| 16 | } |
nothing calls this directly
no outgoing calls
no test coverage detected