+ 1
can someone explain whats wrong si that for loop dosent work?
2 odpowiedzi
+ 4
you should put int x; and the function in main() which you have already close before definition of the function, and the for loop needs a condition not an assignment
https://code.sololearn.com/cCU0PjrOD9q3/?ref=app
0
#include <iostream>
//Function declaration
void printSomething();
int main() {
for(int x=0;x=10;x++){
printSomething();
}
}
//Function definition
void printSomething() {
cout << "Hi there!";
}
u cant use for lop out of function