n00bie questions

Discussion in 'C++' started by Se'noj, Aug 25, 2004.

  1. Se'noj

    Se'noj Guest

    Hi everyone. This is my first post to Usenet, AND I started learning
    to program C++ last weekend, so please bear with me. Two questions...

    Firstly, whenever I compile programs, my compiler (Bloodshed Dev-CPP)
    tells me that iostream.h is deprecated or antiquated. What exactly
    does that mean, and how do I fix it?

    Second, some online tutorials I've seen use std:: at the start of some
    line, but forget to explain what it means. Could anyone help me out
    with that?

    Thanks for your help.


    Bryan Jones
    (aka Se'noj, tlhIngan Hol jatlhwI')
    Se'noj, Aug 25, 2004
    #1
    1. Advertising

  2. Se'noj

    Sharad Kala Guest

    "Se'noj" <> wrote in message
    news:...
    > Hi everyone. This is my first post to Usenet, AND I started learning
    > to program C++ last weekend, so please bear with me. Two questions...
    >
    > Firstly, whenever I compile programs, my compiler (Bloodshed Dev-CPP)
    > tells me that iostream.h is deprecated or antiquated. What exactly
    > does that mean, and how do I fix it?
    >
    > Second, some online tutorials I've seen use std:: at the start of some
    > line, but forget to explain what it means. Could anyone help me out
    > with that?


    You may want to check this FAQ (and others too) -
    http://www.parashift.com/c -faq-lite/coding-standards.html#faq-27.4

    -Sharad
    Sharad Kala, Aug 25, 2004
    #2
    1. Advertising

  3. Se'noj wrote:
    > Hi everyone. This is my first post to Usenet, AND I started learning
    > to program C++ last weekend, so please bear with me. Two questions...
    >
    > Firstly, whenever I compile programs, my compiler (Bloodshed Dev-CPP)
    > tells me that iostream.h is deprecated or antiquated. What exactly
    > does that mean, and how do I fix it?



    That means that you must get another C++ book. C++ is a standardised
    language, and iostream.h was used before the official standard.


    The C++ standard iostream header is <iostream> and *not* <iostream.h>.




    >
    > Second, some online tutorials I've seen use std:: at the start of some
    > line, but forget to explain what it means. Could anyone help me out
    > with that?



    In general, everything in the C++ standard library (except of the
    C-subset .h header files) is defined in namespace std.






    Regards,

    Ioannis Vranos

    http://www23.brinkster.com/noicys
    Ioannis Vranos, Aug 25, 2004
    #3
  4. Se'noj

    K Campbell Guest

    "Sharad Kala" <> wrote in message news:<>...
    > "Se'noj" <> wrote in message
    > news:...
    > > Hi everyone. This is my first post to Usenet, AND I started learning
    > > to program C++ last weekend, so please bear with me. Two questions...
    > >
    > > Firstly, whenever I compile programs, my compiler (Bloodshed Dev-CPP)
    > > tells me that iostream.h is deprecated or antiquated. What exactly
    > > does that mean, and how do I fix it?
    > >
    > > Second, some online tutorials I've seen use std:: at the start of some
    > > line, but forget to explain what it means. Could anyone help me out
    > > with that?


    First, try doing #include <iostream>

    Second, std:: is part of something called a namespace. Namespaces are
    generally used in larger programs so that someone doesn't declare the
    same variable twice.
    using namespace std; means that use all the variables in the namespace
    std
    an example namespace is:

    namespace one
    {
    int j;
    string k;
    }
    int main ()
    {
    one::j = 2;
    using namespace one;
    k = "Hello";
    }

    cout is actually a variable declared under the namespace std;
    you can either do:
    std::cout<<"Hello, World";
    or
    using namespace std;
    cout<<"Hello, World";

    I hope I've been of some help.
    K Campbell, Aug 25, 2004
    #4
  5. Se'noj

    Ali Cehreli Guest

    On Wed, 25 Aug 2004 08:04:59 -0700, K Campbell wrote:

    > "Sharad Kala" <> wrote in message
    > news:<>...
    >> "Se'noj" <> wrote in message
    >> news:...
    >> > Second, some online tutorials I've seen use std:: at the start of
    >> > some line, but forget to explain what it means. Could anyone help me
    >> > out with that?


    > Second, std:: is part of something called a namespace.


    std is the name of the standard namespace. :: is the scope resolution operator.

    > Namespaces are
    > generally used in larger programs so that someone doesn't declare the
    > same variable twice.


    Not only the variables but the names in general.

    > using namespace std; means that use all the variables in the namespace
    > std


    It means that the compiler should look into the specified namespace when it comes accross an unqualified name.

    Ali
    Ali Cehreli, Aug 25, 2004
    #5
  6. Se'noj wrote:

    > Hi everyone. This is my first post to Usenet, AND I started learning
    > to program C++ last weekend, so please bear with me. Two questions...
    >
    > Firstly, whenever I compile programs, my compiler (Bloodshed Dev-CPP)
    > tells me that iostream.h is deprecated or antiquated. What exactly
    > does that mean, and how do I fix it?


    #include <iostream>
    should fix it.

    Probably you need to check the source from which you are learning
    C++. Either the book that you are learning from could be deprecated .
    "C++ Programming Language" - Stroustroup is suggested by one and all.

    >
    > Second, some online tutorials I've seen use std:: at the start of some
    > line, but forget to explain what it means. Could anyone help me out
    > with that?


    Check out for namespaces further in that tutorials.

    All the best.

    --
    Karthik.
    Karthik Kumar, Aug 28, 2004
    #6
    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. Ali Syed
    Replies:
    3
    Views:
    535
    Mark McIntyre
    Oct 13, 2004
  2. pkirk25
    Replies:
    50
    Views:
    1,078
    Bill Pursell
    Oct 4, 2006
  3. Replies:
    10
    Views:
    523
  4. Replies:
    2
    Views:
    1,874
    John Nagle
    Jun 22, 2008
  5. n00bie wants advice.

    , Jul 2, 2008, in forum: Python
    Replies:
    2
    Views:
    263
Loading...

Share This Page