While practicing c++ code, I used the variable that was declared in the for loop.i want it to use it again in another for loop. But it showed me an error that the
variable i was not declared in scope
and I tried the same loop in Eclipse IDE it showed me
the symbol i was not resolved.
The sample code looks similar to this:
#include<iostream>
using namespace std;
int main(){
for(int i=0;i<10;i++){
cout<<i;
}
for(i=10;i<20;i++){
cout<<i;
}
}