0

Hey im a real noob at c++ and im trying to understand creating rooms setting a default and using a .txt file for room details. but i dont understand it. Im looking at some code from my lecturer and i dont understand were the wiz0-2.save comes from can some tell me. or have another tuturiol to help me understand this. Thanks.

//main.cpp
#include "Wiz.h"
#include <iostream>
using namespace std;
intmain()
{
//Create wizards with specific data
Wizard wiz0;//("Gandalf", 25, 100, 10);
Wizard wiz1;//("Loki", 50, 150, 12);
Wizard wiz2;//("Magius", 10, 75, 6);
//Output the wizards before they are loaded
cout<< "BEFORE LOADING..." << endl;
wiz0.print();
wiz1.print();
wiz2.print();
//Create a stream which will transfer the data from
//the specified file "wizdata.txt" to our program
ifstreaminFile("wizdata.txt");
//If the file opened correctly then call load methods
if(inFile)
{
wiz0.load(inFile);
wiz1.load(inFile);
wiz2.load(inFile);
}
//Output the wizards to show data loaded correctly
cout<< "AFTER LOADING..." << endl;
wiz0.print();
wiz1.print();
wiz2.print();
}
3
Contributors
4
Replies
5
Views
5 Years
Discussion Span
Last Post by mikrosfoititis
0

That's not anywhere in your code.

I know that i dont understand where it comes from or why it is there.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.