|
-
December 13th, 2006, 07:41 PM
#2
Re: atoi is making my program crash.
 Originally Posted by JackM
I am using atoi to convert a string to an int, and It is doing that successfully. however, having the following section of code in my program is making the program deliver an error upon reaching "return 0;"
Code:
converted[0] = atoi(score[1].c_str());
converted[1] = atoi(score[3].c_str());
converted[2] = atoi(score[5].c_str());
converted[3] = atoi(score[7].c_str());
converted[4] = atoi(score[9].c_str());
Please read your own post, and see if it is at anyway helpful in finding the problem. The code you posted, will not help others find your error.
Please post a complete, small, and compilable example that demonstrates the problem. No one knows what "converted" is, "score" is, etc., or more important, how, when, where, and with what values this code is being called with.
Regards,
Paul McKenzie
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|