LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices


Reply
  Search this Thread
Old 03-16-2004, 05:27 AM   #1
BACTRATE
Member
 
Registered: Jan 2004
Location: NORTH WEST UK
Posts: 180

Rep: Reputation: 30
g++ compiler and iostream.h


In trying to write basic programs I get what appears to be erratic
errors when using iostream.h and cmath.h in that it tells me to use
the C++ Standard section 17 but where can I find this standard.Cout and Cin
are not recognised by the compiler but this doesn't always happen.
Greatful for any help.

Thanks

Dave
 
Old 03-16-2004, 05:40 AM   #2
dopefish
Member
 
Registered: Nov 2003
Location: Northcliffe, WA
Distribution: Slackware 12.0
Posts: 481

Rep: Reputation: 30
Try using #include <iostream> rather than iostream.h
 
Old 03-16-2004, 11:54 AM   #3
Boogle
LQ Newbie
 
Registered: Mar 2004
Distribution: Gentoo
Posts: 3

Rep: Reputation: 0
The iostream.h library has been depreceted, and replaced with iostream. Functionally they are generally the same, but iostream is now part of the 'std' namespace.

Either g++ no longer supports the deprected iostream.h, or you may be using the two interchangably.

Try:

#include <iostream>

using namespace std; // Without this you would have to use std.cin or std.cout

int main(void)
{
char input[16];
cout << "Enter num: ";
cin >> input;
cout << "\nYou input: " << input;
return 0;
}
 
Old 03-16-2004, 10:47 PM   #4
laceupboots
Member
 
Registered: Dec 2003
Location: Houston
Distribution: Knoppix,lenova yoga 3, Samsung s6 -android
Posts: 307

Rep: Reputation: 30
g++ does support iostream.h, it will give you a warning about "using antiquated headers", but the programs will compile and run properly.
 
Old 03-18-2004, 05:55 AM   #5
BACTRATE
Member
 
Registered: Jan 2004
Location: NORTH WEST UK
Posts: 180

Original Poster
Rep: Reputation: 30
THANKS

Thanks for all the replies,now working ok.

All the best

Dave
 
Old 07-26-2009, 04:12 AM   #6
tqviet
LQ Newbie
 
Registered: Jul 2009
Posts: 2

Rep: Reputation: 0
THANK YOU, Boogle.

I've just got the same trouble. But your example is clear enough.

Cheer !
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
iostream not found krsnachaitanya Linux - Software 4 02-10-2005 06:47 AM
where is iostream invisibleghost Programming 2 10-24-2004 01:30 PM
curses and iostream irfanhab Programming 3 05-10-2004 10:14 AM
g++ why cant i #include \<iostream\> ??? qwijibow Programming 4 10-03-2003 07:17 AM
What's up with iostream.h, is it obsolete? linuxlah Programming 4 02-04-2003 05:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva

All times are GMT -5. The time now is 02:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration