When I try to compile the header file below I get "listings.h(6): error C2146: syntax error : missing ';' before identifier 'accountNumber'"
I am using the .NET compiler.
"string" is not abuilt in data type, but in my main .cpp file I have a #include <string>. I have also tried #include <string> at the top of the header itself.
The header file i am trying to build looks similar to
#ifndef LISTTYPE
#define LISTTYPE
struct listType
{
string accountNumber; //use of string to handle alphanumeric data
string owner;
string street;
string city;
string phone;
};
#endif
How does one make use of strings in a header? This exact struct, when not used in a header, runs perfectly when I put it above main() in my actual program instead of the header.
Thanks
I am using the .NET compiler.
"string" is not abuilt in data type, but in my main .cpp file I have a #include <string>. I have also tried #include <string> at the top of the header itself.
The header file i am trying to build looks similar to
#ifndef LISTTYPE
#define LISTTYPE
struct listType
{
string accountNumber; //use of string to handle alphanumeric data
string owner;
string street;
string city;
string phone;
};
#endif
How does one make use of strings in a header? This exact struct, when not used in a header, runs perfectly when I put it above main() in my actual program instead of the header.
Thanks