reading settings file

Hi, I'm trying to make a basic settings text file and I'm wondering why
pos_y = strAxisData.find(",", pos_x, strAxisData.length());
returns std::string::npos when pos_y = strAxisData.find(","); works fine ?

The settings text file format is:
first coordinate =100,250
second coordinate=133,626
1
2
3
4
5
6
7
8
9
10
11
12
13
string strAxisData;
while(finConfig)
{
	getline(finConfig, strAxisData);
	pos_x = strAxisData.find("=");
	if(pos_x != std::string::npos)
	{
		//int len = strAxisData.length();

	//	pos_y = strAxisData.find(",", pos_x, strAxisData.length());
		pos_y = strAxisData.find(",");
        }
}
Last edited on
soranz wrote:
[...] I'm wondering why
pos_y = strAxisData.find(",", pos_x, strAxisData.length());
returns std::string::npos [...] ?
Because that's how it is designed?

http://www.cplusplus.com/reference/string/string/find/
http://en.cppreference.com/w/cpp/string/basic_string/find
Topic archived. No new replies allowed.