Thread: Access Violation / Seg Fault

  1. #31
    Registered User
    Join Date
    Aug 2007
    Location
    MD, USA
    Posts
    71
    I just wanted to mention that I like the idea of the debug info being output to a file but
    with that I was getting nothing until I put some endl 's in there to flush it to file before the segfaults.
    Now things like this show up and are very helpful:
    Code:
    fout << "12 " << "mortals->next->next= " << mortals->next->next << endl;
    interesting thread , thanks
    Last edited by HowardL; 09-06-2008 at 10:17 AM.

  2. #32
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    FWIW: endl is equivalent to printing a newline and then calling fout.flush(). So if for some reason you want to flush the output without printing a newline, well, now you know how.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. access violation segmentation fault raised in your program
    By dinamit875 in forum C++ Programming
    Replies: 8
    Last Post: 04-23-2009, 11:44 AM
  2. Getting Access Violation (Segmentation Fault)
    By Brownie in forum C++ Programming
    Replies: 2
    Last Post: 09-26-2008, 11:43 AM
  3. Replies: 3
    Last Post: 07-17-2008, 08:45 AM
  4. access violation (segmentation fault)
    By MarlonDean in forum C++ Programming
    Replies: 7
    Last Post: 05-16-2008, 05:02 AM
  5. Locating A Segmentation Fault
    By Stack Overflow in forum C Programming
    Replies: 12
    Last Post: 12-14-2004, 01:33 PM