i was wondering if there was a way to make it so that the program saves a string to a certain value, given by a variable
i.e. str-a
and then after the user inputs the string, the variable number increases, thus making the next input still be str-a but a will have a greater value, and thus be a different string. If this is possible, then is there a way to save the strings for when the program isnt running so that it doesnt start all over again when you start the program again.
also, how do i run a program that i have compiled without opening it in my compiling program?
Notice that the variable theStrings is an array of 3 elements of class type string (requiring the #include <string> directive.) Afterwards, you access each element of the array using the array index starting with 0 and ending with 2... (instead of 1-3 like you might guess since there are 3 elements; arrays always start indexing at 0).
As for saving your strings, you need to learn how to do file manipulation and save the string values to disc, probably using a loop. That would require adding #include <fstream> to your code. It can be a little tricky learning to read and write files correctly, depending on the datatype you are storing. Try searching for help on <fstream>.
ok, that makes sense. but is there a way to make it so that an array of strings is numbered, and after you input the value of that array of strings, the value of the array set goes up by one so that the next array has a different value, so that you can store a near infinite number of arrays?