hi,im seeking for some help
i want the member of my class to be of type string..
so, some of my member function to return a string
but an error is keeping occuring ..
iv tried to include the string heder file in the class heder file.
it says missing type specifier...

# ifndef dayType_H
# define dayType_H

class dayType{
	string  day; 
public:
	//default constructors
	dayType(){day=1;}
	//constructor
	dayType(int currntDay){day= currntDay;}
	//mutator functions
	void setDay(int currntDay);
	//accesseor function
	void printDay();const;
    string getDay();
	void PreviousDay();
	string calculateDay(int );
};

# endif

thanks

Recommended Answers

All 2 Replies

Did you include the <string> header? Do you have a using namespace std or using std::string somewhere prior to your usage of the string name?

yes i tried in the collage but it didnt work but when
i tried now it did fine..thanks alot

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.