|
-
February 12th, 2010, 06:07 PM
#1
creating a string array to hold user inputed thing
Help with the below code. It will not put anything in the arraY?!
string locations[100];
cin >> regionName;
locations[0]=regionName;
while( regionName != STOP)
{
int i = 1;
cout<<end1 << "input" << regionName;
locations[i] = regionName;
cin >> regionName;
int++;
}
Much longer program but i'm having trouble just getting stuff into the array to work with it. my teacher gave us a txt input so it is working and outputting all the regionNames. But when I check to see if anything is inside array above number 2 it doesn't work. And the last regionName enter is always in array part number 1. array spot 0 works... :\ ?
any help would be great
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|