Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 02-07-2003, 06:49 AM   #1
Registered: Dec 2002
Location: Bangalore, India
Distribution: Ubuntu 5.*
Posts: 241

Rep: Reputation: 30
Question C++ cout & cin dead ???

Hello there,
I am using gcc 3.2 version on redhat 8, I want to program in c++, but
i find that using cout << & cin >> is deprecated and i have to compile with
-Wno-deprecated to get my programs work.. can any one throw some light on thismatter.. I am a newbie to c++. Does it mean that cout & cin will no longer be used in c++ ?
Old 02-07-2003, 07:05 AM   #2
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977
it's not deprecated as a concept, unless it's already not the way forward and saviour of programming and i never knew... what i *think* might have changed is the namespace it is in. i believe it was exported by default from std:: but shouldn't be any longer. make sure you are saying "using namespace std;" before using cout / cin or maybe just use the full name "std::cout" rather than just cout. of course i might be talking gibberish. that's been known to happen.
Old 02-07-2003, 10:34 AM   #3
Registered: Dec 2002
Location: Singapore
Distribution: Fedora Core 6
Posts: 647

Rep: Reputation: 30
Old 02-08-2003, 09:51 AM   #4
Registered: Oct 2002
Location: North Atlanta
Distribution: LFS
Posts: 229

Rep: Reputation: 30
my comment and/or question is along these same lines:

i always include:

and get a warning. Besides adding the no deprecated flag in the compile instructions, how do i avoid this warning?

I try using just iostream and then i get the warning that cout and cin are undeclared functions.

How do i get rid of the warning? I am using Anjuta IDE and not the cli g++
Old 02-08-2003, 10:05 AM   #5
Registered: Nov 2001
Location: London, England
Distribution: Gentoo, FreeBSD
Posts: 590

Rep: Reputation: 30
The answer is in the thread moeminhtun linked to.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Can C++ I/O streams (cin, cout) work with ncurses 5.4? Darwish Programming 8 09-29-2005 04:10 PM
cin.ignore Xiangbuilder Programming 4 10-08-2003 08:57 PM
Squid:2nd Browser access Internet SPEED dead becomes dead slow mwj Linux - Software 1 10-04-2003 02:40 PM
g++ and cin.getline() codeviking Programming 8 07-03-2003 08:42 AM
cin.getline adam_boz Programming 6 10-02-2002 09:57 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:29 AM.

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