TM>> #include
TM>> #include
RS> This code is about as likely to work as his pseudo code.
Not up to speed with the way things now work in the Standard C++ language ?
TM>> string name;
TM>> cin >> name;
TM>> if (name=="Cyber Con")
RS> That doesn't work. You're comparing addresses. Use strcmp.
He's doing nothing of the sort. He's actually using the == operator defined
for the standard string class.
TM>> ofstream("file1.fil") << name;
RS> You have to open the file before you can write to it.
TM>> }
RS> And close it when you're done
Tut tut! Even in Classic C++ that snippet of code was perfectly acceptable,
and did exactly the job required. Go back to the manuals and read up about
temporary objects and destructors.
¯ JdeBP ®
--- FleetStreet 1.19 NR
---------------
* Origin: JdeBP's point, using Squish (2:440/4.3)
|