Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C++
Memory errors HELP!
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Daniel T., post: 2544030"] I must say, you have a rather awkward mix of C and C++ code. I think you would be much better off if you removed all the char*s I just ran it out to 1750 lines with no crash... I suspect that your code is only reading in 182 lines. :-/ Did you know you define two different variables both with the name 'i'? (Here and in the for loop below.) Not a good idea and maybe the source of your problem. Change the line above to "int lines = 0;" [i] The above 'i's will have to be changed to 'lines' and a guard would probably be a good idea. while (lines < 20000 && inf.getline(namn[lines], 30) != NULL) ++lines; I suspect that if you put: cout << lines << '\n'; You will find that it outputs 182. Change the '182' above to 'lines' [i][/i][/i] [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C++
Memory errors HELP!
Top