Can some1 please help, i can't figure what went wrong with my program!! I think it has something to do with string names array but don't know how to fix it!!
> infile >> numbers[capacity];
This doesn't fill the array for you, you have to do that yourself with a loop.
All this does it trash beyond the end of the array.
yes, if you know the number of items in the file, try using a 'for' loop, if not, try a while loop. either way, the read command you used will not fill the array properly.