Advertisement Jump to content
Sign in to follow this  

std::string problem

This topic is 4980 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi anybody! I have problem with std::string container. I use guichan ( and when I set new text for TextField, MSVS 6.0 said, that "breakpoint called at code ...", I don't use any breakpoint and i clear theirs for check. I tryed to find bug and it seems, that bug in std::string. I think i use it in wrong way. This is the code with bug:
std::string dir = dir_model->getElementAt(dir_list->getSelected());
if(dir != "..")
	if(path.size() > 3)
		path += '/' + dir; 
	 else path += dir;
	path = findLastDir();
	path = cleanPath(path);
//this is the code with bug
Can anyone tell what the bug is and how to fix it???

Share this post

Link to post
Share on other sites
You mean, "user breakpoint at ..." ?
That's an int3 instruction, probably put there by the compiler, in order to notify you somehow when you're calling to memory addresses not containing actual code.

It is probably a follow-up error. You could
- be using newer or older headers than a library/dll that is linked to your project
- drastically overwriting variables or arrays on the stack, corrupting things like the return address of a function call
- use a library or dll that has been created by a different compiler or uses another STL library (and thus, a different std::string variant)

This line probably does not do what you expect:
path += '/' + dir;

replace it with
path += std::string('/') + dir;

And the other std::string() copy here:

is not needed, making the line
textgield->setText(path + '/');

But no actual errors are in the code you've posted.


Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!