printf return value

This is a discussion on printf return value within the C Programming forums, part of the General Programming Boards category; Hi. On OS X, which is derived from BSD, printf returns 0 if successful. On Linux, it returns the number ...

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

    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
    126
    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, 08: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, 09: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, 12:54 AM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21