stdio.h or cstdio.h ?

This is a discussion on stdio.h or cstdio.h ? within the C Programming forums, part of the General Programming Boards category; Hi guys, I know that in C++ we don't add .h after the include file, to work with the stanard ...

  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    84

    stdio.h or cstdio.h ?

    Hi guys,

    I know that in C++ we don't add .h after the include file, to work with the stanard library.

    How doe's it work in C?
    Should I include:

    stdio.h
    cstdio.h
    stdio ??
    or soething else ...


    Many thanks

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    C++ removes the .h and prefixes c. So cstdio in C++ would be stdio.h in C.
    My best code is written with the delete key.

  3. #3
    Registered User whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    7,706
    If you're working in C++ include <cstdio> to use the C stream library. There really isn't a reason to do this I think apart from special circumstances or the flawed belief that C line-buffered I/O is faster than C++'s line-buffered I/O.

    If you're working in C, the library is <stdio.h>

    When C++ adapted C's standard library, the older header files were renamed using an initial c and no extensions.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. stdio.h cstdio.h
    By salvadoravi in forum C Programming
    Replies: 3
    Last Post: 01-21-2008, 02:00 PM
  2. error: stdio.h: No such file or directory
    By MindLess in forum C Programming
    Replies: 9
    Last Post: 12-20-2007, 07:11 AM
  3. stdio.h
    By Vertex34 in forum C Programming
    Replies: 2
    Last Post: 07-12-2004, 10:18 AM
  4. error in -stdio.h __VALIST
    By JaWiB in forum C++ Programming
    Replies: 3
    Last Post: 09-20-2003, 12:22 PM
  5. Modifying stdio.h
    By Spectrum48k in forum C Programming
    Replies: 10
    Last Post: 05-29-2002, 08:30 AM

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