I have a program that reads inputs from file and using a switch statement choose to read more information from other files.
Although I can read the first file ("a.txt"), i can't seems to read the second file ("0.txt").
loc is suppose to be a global variable read from a.txt and is used for loading another set of files.
I don't know what is the problem as the text ("This is a sample text." ) in 0.txt is not loaded or displayed.
Can anyone tell me where did I go wrong?
Thanks in advance.
int LoadLoc()
{
char desc[256];
switch(loc)
{
case 1:
cout << "Loading location. \n";
ifstream b_file ("0.txt");
b_file >> desc;
cout << desc;
b_file.close();
break;
/*
default:
cout << "Loading location. \n";
//break;
*/
}
presskey();
}



LinkBack URL
About LinkBacks



