K
KevinSimonson
I had a working piece of code that successfully read from files with
the "ifstream" type and wrote to files with the "ofstream" type. This
code is made up of a number of different files. In the course of the
job I needed for two of these files to have access to one piece of
information, so I created a class that I called "CSuffix" and stored
the common information there. So I created a "Suffix.h" file that
looks like:
#pragma once
class CSuffix
{
public:
static void initialize ();
static void increment ();
static char* latest ();
}
That's it in its entirety. Now I put a line that says, '#include
"Suffix.h"' among my includes, right before the line that says,
'#include <iostream>'. And all of a sudden the compiler doesn't
recognize either my "ifstream"s or my "ofstream"s. All I have to do
is comment out the line that says, '#include "Suffix.h"' and then all
my "ifstream"s and "ofstream"s start working again (although obviously
the compiler then complains about my calls to my three "CSuffix"
methods). So it looks to me like I must be doing something wrong in
my "Suffix.h" file. Can anyone see what the problem is?
Kevin S
the "ifstream" type and wrote to files with the "ofstream" type. This
code is made up of a number of different files. In the course of the
job I needed for two of these files to have access to one piece of
information, so I created a class that I called "CSuffix" and stored
the common information there. So I created a "Suffix.h" file that
looks like:
#pragma once
class CSuffix
{
public:
static void initialize ();
static void increment ();
static char* latest ();
}
That's it in its entirety. Now I put a line that says, '#include
"Suffix.h"' among my includes, right before the line that says,
'#include <iostream>'. And all of a sudden the compiler doesn't
recognize either my "ifstream"s or my "ofstream"s. All I have to do
is comment out the line that says, '#include "Suffix.h"' and then all
my "ifstream"s and "ofstream"s start working again (although obviously
the compiler then complains about my calls to my three "CSuffix"
methods). So it looks to me like I must be doing something wrong in
my "Suffix.h" file. Can anyone see what the problem is?
Kevin S