My preamble: sorry if my q is mundane.
I'm leanring form "the complete idiot's guide" (not recomended btw). Here's the code they have you type, it's a runtime array:
#include <iostream.h>
#define max 40
main()
{
int number[max];//intlz array<max ie 40
int count=0;
int index;
int more;//promt user for more
while (1)//loop to get data
{
cout<<"enter number ";
cin>>number[count];//why do we need [count]
cout<<"More y/n";
cin>>more;
if (more=='n')//if statment ie continue or not
{
break;//
}
else
{
count++;
}
}
return(0);
}
I run it and it won't stop. As far as I can tell the else statment doesn't repeat back into the loop, but I don't know what to put in.
Thanx in advance!