| youngcoder13 (21) | |
|
Hello, I made a text application (command line tool) on xcode in C++. In the int main you can "program" the text adventure. I made a void called game which is where the game starts once the user decides to test out his "text adventure". The problem is that when I run it void game does not understand the strings because they are in the int main. How would I explain to the void game what the strings are (for example: The games name, the authors name etc). Thank you. This is a small preview: String gamename; getline(cin,gamename); //More code... void game (){ cout << "Welcome to" << gamename; - Use of undeclared identifier } | |
|
Last edited on
|
|
| Disch (8349) | |||
pass them as a parameter
| |||
|
|
|||