I have this problem with strings and my constructor. MV C++ tells me that strings in the constructor (within the security class) of my security.cpp file are not recognized. if i delete the member "Type" from the constructor then the program works as expected. The security.h file appears working fine so i am not sure if the problem is there or in the .cpp file.
Any help is appreciated!!!
here is security.h:
#ifndef SECURITY_H
#define SECURITY_H
class Security
{private:
double p;
double c;
double d;
int e;
int t;
That's because there's no such primitive type as "string". There is int, and double, and float, and char, and others like that, but not string.
If you want to use some object of type "string" you must either define it yourself, or include something that defines it for you (e.g. a header file that defines something called "string"). You have not done this in security.h
Note that security.h gets copied wholesale into security.cpp where it is included. You then go on to define a std::string type two lines later, with #include <string> , but that's too late for where you try to use a string type in security.h