Archived

This topic is now archived and is closed to further replies.

billybob

std::string::size or length ARRRGGGH

Recommended Posts

billybob    134
i'm getting a crash in std::string::size or std::string::length NO MATTER WHAT I DO. every single freaking time crash and asks for strlen.asm. THIS crashes:
int main(int argc, char ** argv)
{
 std::string test("lala");
 printf("%d", test.length());
 return 0;
}
  
so is it just a worthless piece of crap (sure seems like it) or what am i doing wrong. [edited by - billybob on March 17, 2003 3:51:18 AM]

Share this post


Link to post
Share on other sites
Sneftel    1788
hmmmmmm. Tricky problem. Step down through the stack trace into the frame that calls strlen, and find out whether the arguments it''s passing in are valid.


How appropriate. You fight like a cow.

Share this post


Link to post
Share on other sites
SiCrane    11839
What compiler and STL implementation are you using? The code, as you''ve posted it, looks fine.

Share this post


Link to post
Share on other sites
billybob    134
msvc++ 6, don''t know what STL version it is. i know it should be fine but no matter what i do it never works. i''ve tried strlen("lala") and it works perfectly, so i have no idea why this doesn''t work.

Share this post


Link to post
Share on other sites
Sneftel    1788
Downloading STLPort would be a avoiding rather than solving the problem, but it might be your easiest way out.

Have you done any messing around with library linking? (Debug versus Release, Single-Threaded versus Multithreaded)


How appropriate. You fight like a cow.

Share this post


Link to post
Share on other sites
billybob    134
bah it worked, i wasted SOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO MUCH TIME on that.

edit: STL port did.

[edited by - billybob on March 17, 2003 7:21:27 AM]

Share this post


Link to post
Share on other sites