1
edit
Changes
→Q & A
'''A:''' I have (Kevin from Team 9). What kind of crash are you talking about? Everything works fine when I compile.<br>
'''Q:'''It compiles, but when we edit the line for the first time and then press enter, then it crashes.<br>
'''A:''' Make sure that you aren't overwriting the null byte at any point in the editing. After terminating the edit() function, a1test does a strcmp() of str and the successful string. <br>If str is missing a null byte, it might be strcmp() crashing your program. Are you getting a seg fault? (Submitted by: Team 9)
'''Q:''' How to avoid heap corruption? When I run a1test if I keep pressing RIGHT, the program crashes with heap corruption. Even when<u>I replace my custom line edit code with skeleton methods (display does nothing, edit returns RIGHT) the program still crashes with corrupt heap</u>
<br>
'''A:''' List any dynamic allocations you are using (and check for doubled delete [] statements), and refer to [http://www.efnetcpp.org/wiki/Heap_Corruption this page] for more information on potential problems.<br>
Also, make sure that you're not offsetting or repositioning past the end of the string allocation. That could cause problems. (Submitted by Team 9)<br>
'''Submitted by:''' Team 6 <br><br>