why does my second loop (for a....) not return pupil[0] it will only start from pupil[1]
Code:#include <iostream> #include <string> using namespace std; int main(){ char *pupil[10]= { "Ben", "Graham", "Joe", "James", "Tom", "Tim"}; char house[]= {0,6}; char clss[]= {0,6}; char game1[]= {0,6}; char game2[]= {0,6}; char game3[]= {0,6}; char game4[]= {0,6}; char ingame[]= {0,6}; char x; int b=1; for(int i = 0;i <= 5; i++){ cout<<i; cout<<"Enter house for : "<<pupil[i]<<endl; cin>>x; house[i]=x; } for(int a = 0;a <= 5;a++){ cout<<pupil[a]<<endl; cout<<house[a]<<endl; } return 0; }



LinkBack URL
About LinkBacks


