class Ninja: public Enemy{
public:
void attack()
{
myfile<<" Ninja Chop -"<< attackPower<<endl;
}
};
instead of cout, myfile.
It compiles perfectly but the "Ninja Chop-20" is missing from the command prompt
and the text file was not created.
Any other options. Thanks
Yes but don't in your constructor you need to open a file with your ofstream.
And if you want it in the command promp also then use cout and myfile streams. So it sends to the txt and console. Sorry for the late response was busy.
Thanks,its okay.
wait, so you're telling me not to put in the constructor
First, I need to open a file and then start putting my output in there..
Is that what you're trying to say..?