0

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

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by moonL!ght
0

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?

Edited by Narue: n/a

0

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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.