Fairly Dumb C++ Question.
Sorry to make this my first post.
I've been reading all over the internet about arrays and I just can't seem to find exactly what I need. All I want is to store strings into an array.
The hope is that I can make an array with strings like infile1.txt, infile2.txt ect ect.
Then use the fstream to open a file based on a varible. So if array[32] = infile32.txt then somewhere down the line I could have a function that would be called something like filetoopen(string).
So I'd have a while loop. that called the filetoopen() function using a varible like string helpfulVariable ; That would cycle through the array.
Is this making any sense?
While looking all the internet I couldn't find how to make an array of strings. Not an array of characters that happen to be words like C. ACTUAL strings. Can anyone point me in the correct direction?
|