"string" is undefined

Jul 25, 2011 at 11:03pm
hey does anyone knwo why do i get an Error: identifier "string" is undefined. when i use this code in a class header file...
1
2
3
4
5
6
7
8
9
10
11
#pragma once
#include <string>

class newproduct
{
public:
	newproduct(void);
	~newproduct(void);
	string add();
};
Jul 25, 2011 at 11:06pm
string is in the std namespace, so you need to write std::string.
Jul 25, 2011 at 11:09pm
thanks you're right
Topic archived. No new replies allowed.