Ok, I'm back, and I have a new question. What am I doing wrong in this code?
It gives me an error about using the wrong data type. What am I doing wrong and how can I fix it?Code:int save() { char * filename; char * fileext = ".rpg"; cout<<"Save game?\n"; cin>>choice; if (choice=="yes" || choice=="y" || choice=="Y" || choice=="Yes" || choice=="yES" || choice=="YES" || choice=="YeS" || choice=="yEs" || choice=="YEs" || choice=="yeS") { cout<<"Save filename?\n"; cin>>filename; filename=filename+fileext; std::ofstream output(filename); output <<startpoint<<' '<<yourname<<' '<<hp<<' '<<weapon<<' '<<attack<<' '<<maxhp<<' '<<gold<<' '<<frags<<' '<<dmg<<' '<<block<<' '<<bow<<' '<<handgrenade<<' '<<broom<<' '<<rope<<' '<<grapple<<' '<<stairboots<<' '<<goldplate<<' '<<goldgoblet<<' '<<goldbowl<<' '<<goldflatware<<' '<<rockbuster<<' '<<bluessword<<' '<<smsand<<' '<<lgsand<<' '<<bacon<<' '<<rbeef<<' '<<bbqpork<<' '<<bbqbeef<<' '<<chicken<<' '<<steak<<' '<<apple<<' '<<pear<<' '<<plum<<' '<<pineapple<<' '<<peach<<' '<<papaya<<' '<<cheese<<' '<<candy<<' '<<beaten<<' '<<broomequip<<' '<<rockbusterequip<<' '<<bluesswordequip<<' '<<bowgive<<' '<<taken<<' '<<computer<<' '<<motherboard<<' '<<floppydrive<<' '<<harddisk<<' '<<compucase<<' '<<os<<' '<<rps<<' '<<calculate<<std::endl; output.close(); cout<<"Game Saved.\n"; } else { } system("pause"); }