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

Threaded View

  1. #2
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: Segmentation Faults are hard to find

    Use code tags to preserve indentation.

    If you're on a Linux machine, run the program through valgrind. It'll pinpoint the first suspicious line a lot better than just running it straight.

    If not, then at least run it in a debugger. Might learn something that way.

    Got to say, hard-coding 3s, 4s, and 5s everywhere isn't the way to go. Not really surprised you ran into trouble, relying on your own memory to keep all the array sizes updated like that. You should stick those values into variables once and forget about them, or use strlen() or somesuch. Anything but hard-coding.
    Last edited by Lindley; September 10th, 2009 at 09:16 PM.

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