Difference and Histroy about inluding of header without h - c++

This is a discussion on Difference and Histroy about inluding of header without h - c++ ; 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...

+ Reply to Thread
Results 1 to 6 of 6

Difference and Histroy about inluding of header without h

  1. Default Difference and Histroy about inluding of header without h

    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

  2. Default Re: Difference and Histroy about inluding of header without h

    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.

    V
    --
    Please remove capital 'A's when replying by e-mail
    I do not respond to top-posted replies, please don't ask

  3. Default Re: Difference and Histroy about inluding of header without h

    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

  4. Default Re: Difference and Histroy about inluding of header without h

    In article <gac1i1$hqc$1@aioe.org>, Rainer Heynke <noreply@plucked.de> wrote:

    > 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>


    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. Rather than break code using pre-ISO headers or try
    to find a backwards-compatible solution for every compiler's headers
    (especially difficuly with the introduction of namespaces and everything
    in std), they chose to use new names. Apparently extensionless names were
    the least-conflicting, technically and politically. Keep in mind that
    there is no requirement about how a compiler actually implements lines
    like #include <iostream>; it might include the contents of a file named
    "iostream", "iostream.cplusplustandardheader", "foobar", or might not
    include a file at all, instead merely enabling use of the names contained
    in it, whose implementation is internal to the compiler.

  5. Default Re: Difference and Histroy about inluding of header without h

    On Sep 12, 9:27 am, blargg....@gishpuppy.com (blargg) wrote:
    > In article <gac1i1$hq...@aioe.org>, Rainer Heynke
    > <nore...@plucked.de> 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:james.kanze@gmail.com
    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

  6. Default Re: Difference and Histroy about inluding of header without h

    On Sep 11, 11:27 pm, Victor Bazarov <v.Abaza...@comAcast.net> 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:james.kanze@gmail.com
    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

+ Reply to Thread