kindly Remove this 1 simple error

Gives Error: string undeclared identifier in void setName (string first, string last);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef personType_h
#define personType_h
#include <iomanip>
#include <string>
class personType
{
public:
	void print() const;
	//Function to output the first name and last name.
	//the form firstName lastName
	void setName(string first, string last);
	//Function to set firstName and lastName according
	//to the parameters.
	//Postcondition: firstName = first; lastName = last
	personType& setFirstName(string first);
	//Function to set the first name.
	//Postcondition: firstName = first
	// After setting the first name, a reference
	// to the object, that is, the address of the
	// object, is returned.
	personType& setLastName(string last);
	//Function to set the last name.
	//Postcondition: lastName = last
	// After setting the last name, a reference
	// to the object, that is, the address of the
	// object, is returned.
	string getFirstName(
		) const;
	//Function to return the first name.
	//Postcondition: The value of firstName is returned.
	string getLastName() const;
	//Function to return the last name.
	//Postcondition: The value of lastName is returned.
	personType(string first = "", string last = "");
	//Constructor
	//Sets firstName and lastName according to the parameters.
	//Postcondition: firstName = first; lastName = last
	private
		:
	string firstName;
	//variable to store the first name
	string last
		Name; //variable to store the last name
};

#endif 
use std::string
Thanks abhishekm.
Last edited on
Topic archived. No new replies allowed.