n00bie questions

S

Se'noj

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')
 
S

Sharad Kala

Se'noj said:
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
 
I

Ioannis Vranos

Se'noj said:
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

K Campbell

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

Ali Cehreli

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
 
K

Karthik Kumar

Se'noj said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top