C++

This is a discussion on C++ within the C++ Programming forums, part of the General Programming Boards category; hello everyone can tell me what diffrent #include<stdio.h> and #include<iostream> thank you~!...

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    2

    Unhappy C++

    hello everyone

    can tell me what diffrent
    #include<stdio.h>
    and
    #include<iostream>

    thank you~!

  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    17
    <stdio.h> is for the c standard of i/o, and includes functions such as scanf and prinf
    <iostream> is for the c++ standard of i/o, and includes functions such as cin and cout

    Furthermore, <iostream> is if you want the iostream functions to be in the std:: namespace. Otherwise, the functions included in <iostream.h> reside in the local namespace. If this paragraph confuses you, you may want to use <iostream.h> until you learn the difference.
    -sh0x

  3. #3
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,267
    well the difference is

    #include<stdio.h>

    include the C standard i/o functions

    such as

    input:

    scanf()
    gets()
    getchar()
    ect...

    output:

    printf()
    putchar()
    putc()
    ect...

    #include<iostream>
    // note there is a difference between this an <iostream.h>

    includes the std namespace

    that has all the C++ standard, i/o vectors, maps ect...ect...

    input

    std::cin

    output

    std::cout
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

Popular pages Recent additions subscribe to a feed

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