Difference and Histroy about inluding of header without h

Discussion in 'C++' started by Rainer Heynke, Sep 11, 2008.

  1. Hi,

    a friend of mine ask about the reason and the history beyond the two
    different ways to include std-headers like

    #include "stdio.h"
    #include <cstdio>


    He's no using the usenet, but he read the answers via google.




    Rainer
    Rainer Heynke, Sep 11, 2008
    #1
    1. Advertising

  2. Rainer Heynke

    Default User Guest

    Rainer Heynke wrote:


    >
    > He's no using the usenet, but he read the answers via google.


    Google Groups allows one to post as well as read.




    Brian
    Default User, Sep 11, 2008
    #2
    1. Advertising

  3. Rainer Heynke

    James Kanze Guest

    On Sep 12, 9:27 am, (blargg) wrote:
    > In article <gac1i1$>, Rainer Heynke
    > <> wrote:


    > > a friend of mine ask about the reason and the history beyond
    > > the two different ways to include std-headers like


    > > #include "stdio.h"
    > > #include <cstdio>


    > Before C++ became an ISO standard, there were already many C++
    > headers like iostream.h and similar, whose functionality
    > differed from one compiler to another.


    Actually, the functionality differed less than the names. Some
    compilers had <iostream.h>, <strstream.h>, etc.; others
    <iostream.hpp>, <strstrea.hpp>, etc.; and who knows what else.

    --
    James Kanze (GABI Software) email:
    Conseils en informatique orientée objet/
    Beratung in objektorientierter Datenverarbeitung
    9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
    James Kanze, Sep 12, 2008
    #3
  4. Rainer Heynke

    James Kanze Guest

    On Sep 11, 11:27 pm, Victor Bazarov <> wrote:
    > Rainer Heynke wrote:
    > > a friend of mine ask about the reason and the history beyond
    > > the two different ways to include std-headers like


    > > #include "stdio.h"
    > > #include <cstdio>


    > > He's no using the usenet, but he read the answers via
    > > google.


    > Standard headers are never included with quotes, always with
    > angle brackets. So, you shouldn't at all see


    > #include "stdio.h"


    > but always


    > #include <stdio.h>


    > . As to the presence of '.h', it's specific to C. Standard
    > C++ headers do not have '.h' in them.


    Both <stdio.h> and <cstdio> are part of standard C++. Based on
    the C++03 standard, very few compilers actuallly implement
    <cstdio> correctly, however, so it's probably best to avoid it.

    --
    James Kanze (GABI Software) email:
    Conseils en informatique orientée objet/
    Beratung in objektorientierter Datenverarbeitung
    9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
    James Kanze, Sep 12, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andrew Price

    Inluding a file in ASP+

    Andrew Price, Feb 1, 2005, in forum: ASP .Net
    Replies:
    10
    Views:
    804
    Andrew Price
    Feb 1, 2005
  2. jakk
    Replies:
    4
    Views:
    12,117
  3. s.subbarayan
    Replies:
    4
    Views:
    15,846
    Dan Pop
    May 21, 2004
  4. Replies:
    12
    Views:
    834
    John Harrison
    Mar 2, 2007
  5. mlt
    Replies:
    2
    Views:
    831
    Jean-Marc Bourguet
    Jan 31, 2009
Loading...

Share This Page