I'm sorry, I forgot that information.
Compiler: MingW/GCC 3.2
Platform: Dev-C++ Version 4.9.7.6
OS: Windows XP
Here is a small sample:
Code:
void read_data(string ID,istream& in)
{
fstream data;
char class_name[10];
int counter = 0;
string ident;
char mark;
while (counter<7)
{
for (int j=0;j<1;j++)
{
in>>class_name;
cout<<class_name;
system("pause");
data.open("class_name.dat", ios::in);
if (! data.is_open())
cout<<" file did not open"<< data;
else
cout<<" file did open"<< data;
I know that class_name is supposed to be the filename, but I was wanting to debug to be for certain what filename was stored in data. Because when this section of code runs, the "file did not open" line runs and at the time there is a file of that name that does exist in the directory. How do I print out the filename in data. And I have tried to store data's contents in a string, but it will not let me make the conversion.
Thanks for the reply.
Any info will be greatly appreciated.
Gratefully,
Kendal