A
Andreas Schmitt
Hi,
I got a problem here that I haven't been able to fix so far since I don't
even know what the problem is.
I have the following two files (among one other 'Class1.cpp') in my Project
in Visual C++
The MainFile.cpp works fine, but as soon as I try to use strings in
Class1.hpp the compiler reports an error
and claims he doesn't know the 'string' variable type.
Why does he know in the first file and not in the second?
I have the necessary <string> included in both files, yet he doesn't know
the string type in one of them..??
Any help would be appreciated
Thanks
********************
** MainFile.cpp:
********************
#include <stdio.h>
#include <string>
#include <time.h>
#include "Class1.hpp"
using namespace std;
int main()
{
....
string myString[3] = {"Content1", "Content2", "Content3"};
....
return 0;
}
********************
** Class1.hpp:
********************
#ifndef CLASS1_HPP
#define CLASS1_HPP
#include <string>
class Class1
{
public:
Team();
~Team();
...
private:
string myString2;
....
};
#endif
I got a problem here that I haven't been able to fix so far since I don't
even know what the problem is.
I have the following two files (among one other 'Class1.cpp') in my Project
in Visual C++
The MainFile.cpp works fine, but as soon as I try to use strings in
Class1.hpp the compiler reports an error
and claims he doesn't know the 'string' variable type.
Why does he know in the first file and not in the second?
I have the necessary <string> included in both files, yet he doesn't know
the string type in one of them..??
Any help would be appreciated
Thanks
********************
** MainFile.cpp:
********************
#include <stdio.h>
#include <string>
#include <time.h>
#include "Class1.hpp"
using namespace std;
int main()
{
....
string myString[3] = {"Content1", "Content2", "Content3"};
....
return 0;
}
********************
** Class1.hpp:
********************
#ifndef CLASS1_HPP
#define CLASS1_HPP
#include <string>
class Class1
{
public:
Team();
~Team();
...
private:
string myString2;
....
};
#endif