Great what did I miss?

Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jan 2005
Posts: 66
Reputation: Kiba Ookami is an unknown quantity at this point 
Solved Threads: 1
Kiba Ookami's Avatar
Kiba Ookami Kiba Ookami is offline Offline
Junior Poster in Training

Great what did I miss?

 
0
  #1
Feb 28th, 2006
I messed with C++ my first year in programming, and now as an AP student its all Java focused. As I want to be a game programmer I decided to get back to learning C++ because I've heard its often used.

So, I downloaded Bloodshed Dev-C++, which was reccomended by a guy I know.

Well, I pulled up a website tutorial, typed up the most basic "Hello World" application to reaquaint from square one, and upon compiling it...

It calls <iostream.h> an antiquated header. It says to reference some standard 32 headers or whatnot somewhere...I'm not too knowlageable in the world wide use of C++, or any language, as I've only had local useage, but when the heck does someone just decide to up and change a standard language?

In closing though, whats wrong with the program? I've the code below...

//include this file for cout
#include <iostream.h>

int main()
{

//print out the text string, "Hello, World!"
cout << "Hello, World!" << endl;

return 0;

}
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 598
Reputation: SpS is on a distinguished road 
Solved Threads: 32
SpS's Avatar
SpS SpS is offline Offline
Posting Pro

Re: Great what did I miss?

 
0
  #2
Feb 28th, 2006
chnage your code to
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.  
  7. //print out the text string, "Hello, World!"
  8. cout << "Hello, World!" << endl;
  9.  
  10. return 0;
  11.  
  12. }
Reply With Quote Quick reply to this message  
Join Date: Jan 2005
Posts: 66
Reputation: Kiba Ookami is an unknown quantity at this point 
Solved Threads: 1
Kiba Ookami's Avatar
Kiba Ookami Kiba Ookami is offline Offline
Junior Poster in Training

Re: Great what did I miss?

 
0
  #3
Feb 28th, 2006
Might I have an explination as to whats up with the change, and a point to an online tutorial thats up to date?

Also, it compiles now but it does not bring up a console, it flashes it and closes it.
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 505
Reputation: Bench has a spectacular aura about Bench has a spectacular aura about Bench has a spectacular aura about 
Solved Threads: 51
Bench's Avatar
Bench Bench is offline Offline
Posting Pro

Re: Great what did I miss?

 
0
  #4
Feb 28th, 2006
Originally Posted by Kiba Ookami
Might I have an explination as to whats up with the change, and a point to an online tutorial thats up to date?
The reason for the change is a little long-winded and boring, but it has to do with the fact that up until 1999, C++ was not standardised. When the standardisation came along, the ISO Committee decided that requiring vendors to modify their own versions of iostream.h could potentially break so much legacy code, that the best solution was to allow the vendors to keep their deprecated iostream.h, and add the new, standard one in the form of <iostream>. The same is true for all standard library headers (eg, <string>, <vector>, etc). There is also talk that one day, the older headers ending in ".h" may be completely removed from C++


As for tutorials, be aware that many are of varying quality, and sometimes mix old and new code. Nevertheless, there's alot of information around. My favourite starting point for any subject is Wikipedia, so have a look here: http://en.wikipedia.org/wiki/C_Plus_Plus
The links section in the wiki entry (right at the bottom) has a bunch of tutorials and other useful C++ stuff - plenty to keep you in reading material.

If you can afford it, buy a good quality beginners' C++ book. The ACCU (Association of C and C++ Users) has a reliable book reviews section. ( http://www.accu.org )

If you can't afford a book at the moment, check out Bruce Eckel's free ebook on his site http://mindview.net/Books/TICPP/ThinkingInCPP2e.html
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,867
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 755
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Senior Bitch

Re: Great what did I miss?

 
0
  #5
Feb 28th, 2006
>There is also talk that one day, the older headers ending in ".h" may be completely removed from C++
You're confusing the C library headers, which *are* deprecated, with the non-standard C++ headers. The difference is that iostream.h and friends aren't required to be supported by an implementation in any way, while the C headers must be supported now, but could be removed in a future revision.
New members chased away this month: 5
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum


Views: 1320 | Replies: 4
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC