CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Threaded View

  1. #2
    Join Date
    Apr 1999
    Posts
    27,449

    Re: Don't know why program keeps crashing

    Quote Originally Posted by SMA01 View Post
    I am reading in values from a file, and am not sure what's wrong with my code? My main issue is within the area in bold, can anyone tell me what's wrong?
    First, post the entire call to the function. We have no idea if the parameter you passed in is bogus or not, and everything relies on that parameter being valid. Note that your loop is wholly dependent on what was passed, as you're checking for NULL and doing different things if intList is NULL or not.

    Second, did you debug your code, or are you just running it and having it crash? If it is the latter, please use the debugger to debug the code. More than likely those pointers are invalid or uninitialized , and you're trying to write to an uninitialized pointer.

    Bottom line is this -- you're asking us to figure out your logic. You wrote the program, so you had some sort of logic in mind, and translated what you had in mind to code. So does your program follow your logic? Where does the program go counter to what you expected? That's what debugging is all about.

    Regards,

    Paul McKenzie
    Last edited by Paul McKenzie; December 19th, 2012 at 02:00 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured