I am having issues with my game. I haven't made much of a game so far, but I am trying to call a string using a external function from my bin class. When I compile, It says I can't have non-static variables.
#include <iostream>
#include <stdlib.h>
using namespace std;
class Bin {
string gameStart = "How would you like to start?\n";
};
Bin bin1;
int main () {
cout << bin1.gameStart;
}
Just for reference, I have tried looking for solutions, but to no prevail.
Update: Hi again. I have read some of the feedback from my question. I see that Raw N and Angew have made some valid points. I would like to ask if these two nice people: Where does the header go. How can i get that version of the compiler?
Thanks!
Update: I managed to find out how to compile my code in c++14. There is a console command that can be used for this. I updated my open.bat file, which i use to compile my notepad code. Everything is working fine now. Thanks all!