Thread: How to debug putchar()

  1. #1
    Registered User
    Join Date
    Jul 2010
    Posts
    37

    How to debug putchar()

    I am trying to debug putchar with xcode but I can't see the characters in the console window?
    Any ideas on this one?

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    My psychic debugger suggests that you flush stdout before expecting any output in the console window:
    Code:
    putchar(c);
    fflush(stdout);
    Unless the character being printed is guaranteed to be '\n', of course. That character forces a flush.
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 04-12-2010, 12:57 PM
  2. Binary was not built with debug information.
    By studentffm in forum C++ Programming
    Replies: 2
    Last Post: 01-25-2010, 12:13 PM
  3. temperature sensors
    By danko in forum C Programming
    Replies: 22
    Last Post: 07-10-2007, 07:26 PM
  4. crazy triangles
    By markg in forum C Programming
    Replies: 3
    Last Post: 10-24-2005, 12:50 PM
  5. Text based frame in win32 console
    By GaPe in forum C Programming
    Replies: 8
    Last Post: 04-16-2002, 07:01 AM