Files
CPP/arrays/sizeof_loop.cpp
rattatwinko 79670e7723 some more
2025-04-29 20:53:38 +02:00

16 lines
366 B
C++

/*
We use the sizeof Opperator here to determine the size of the Array "numbers" {in this case 10} ;
After that we print "i" Element in "numbers"
*/
#include <iostream>
using namespace std;
int main() {
int numbers[10] = {1,2,3,4,5,6,7,8,9,10};
for (int i = 0; i < sizeof(numbers) / sizeof(numbers[0]) ; i++) {
cout << numbers[i] << "\n";
}
}