Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C++ (http://www.velocityreviews.com/forums/f39-c.html)
-   -   n00bie questions (http://www.velocityreviews.com/forums/t285206-n00bie-questions.html)

Se'noj 08-25-2004 10:13 AM

n00bie questions
 
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')

Sharad Kala 08-25-2004 10:15 AM

Re: n00bie questions
 

"Se'noj" <tlhingan@gmail.com> wrote in message
news:39d43bd0.0408250213.71b9b22@posting.google.co m...
> 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-lit....html#faq-27.4

-Sharad



Ioannis Vranos 08-25-2004 11:30 AM

Re: n00bie questions
 
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

K Campbell 08-25-2004 03:04 PM

Re: n00bie questions
 
"Sharad Kala" <no__spam.sharadk_ind@yahoo.com> wrote in message news:<2p375lFg1t6eU1@uni-berlin.de>...
> "Se'noj" <tlhingan@gmail.com> wrote in message
> news:39d43bd0.0408250213.71b9b22@posting.google.co m...
> > 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.

Ali Cehreli 08-25-2004 05:12 PM

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

> "Sharad Kala" <no__spam.sharadk_ind@yahoo.com> wrote in message
> news:<2p375lFg1t6eU1@uni-berlin.de>...
>> "Se'noj" <tlhingan@gmail.com> wrote in message
>> news:39d43bd0.0408250213.71b9b22@posting.google.co m...
>> > 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

Karthik Kumar 08-28-2004 06:15 AM

Re: n00bie questions
 
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.


All times are GMT. The time now is 08:05 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.