Files
CPP/arrays/array_for.cpp
2025-04-29 20:21:12 +02:00

11 lines
242 B
C++

#include <iostream>
using namespace std;
int main() {
string cars[4] = {"Volvo", "Opel", "Volkswagen", "Auto"};
for (int i = 0; i < 4 ; i++) { // needs to be size of cars array else segfault
cout << cars[i] << "\n";
}
}