String Complier Error

c++ members, I have run into a complier error on line "name. The complier error says "no suitable constructor exists to convert from "size_t" to "std::basicstring__char....

Hopefully, you guys would understand what I'm trying to say. Can I know what this error means and at the same time how can I fix this :)

1
2
3
4
5
6
string nameindex(string name)
{
	
	return name.find(',');
	
}
std::string::find() returns a std::size_t.

Your function expects to return a string.
Last edited on
Topic archived. No new replies allowed.