Thread: printf return value

  1. #1
    Registered User
    Join Date
    Feb 2011
    Posts
    144

    printf return value

    Hi.

    On OS X, which is derived from BSD, printf returns 0 if successful. On Linux, it returns the number of characters printed. Is there some way that my code can detect what platform it's being compiled on, or a way to alter the behaviour of printf?

    Richard

  2. #2
    Registered User
    Join Date
    Feb 2011
    Posts
    144
    Sorry, my bad. I was looking at man printf instead of man 3 printf. I'm a newbie. Please move along.

    Richard

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. making it portable.....?
    By ShadeS_07 in forum C Programming
    Replies: 11
    Last Post: 12-24-2008, 09:38 AM
  2. Smart pointer class
    By Elysia in forum C++ Programming
    Replies: 63
    Last Post: 11-03-2007, 07:05 AM
  3. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM
  4. Drawing tables in C
    By stanoman in forum C Programming
    Replies: 5
    Last Post: 10-09-2003, 10:14 AM
  5. Algorithm to walk through a maze.
    By Nutshell in forum C Programming
    Replies: 30
    Last Post: 01-21-2002, 01:54 AM

Tags for this Thread