473,395 Members | 1,473 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Current status of iostream.h

Hello, I'm relatively new to C, although I've touched the subject several
times for a couple of years. Tutorials etc. always taught me that I should
use (in the beginning at least) cin and cout when outputting text to the
screen.

Recently, when giving C another shot with the new GCC 3.3, I couldn't use
the functions defined in iostream.h anymore. I don't remember the actual
errors, but i think that the library had been separated into istream.h and
ostream.h. I seem to recall a warning as well, when using any of the
functions in those files.

Is iostream getting deprecated, or was I just using it wrong? I'm using GCC
2.95.4 at the moment, so I can't recreate the errors again for now. I do,
however, want to know if I should use iostream for file-io etc. or if
another library has taken it's place.

I like to be aware of how to do things the "right" way, and following
standards and so on, so a change of this caliber might as well catch my
radar now, so I won't have that problem the next time I'm confronted with a
newer GCC-version.

Any answers to this matter would be appreciated. Thank you.
Nov 13 '05 #1
5 4977
"Tim Cambrant" <ti*@cambrant.com> wrote:
Hello, I'm relatively new to C, although I've touched the subject
several times for a couple of years. Tutorials etc. always taught
me that I should use (in the beginning at least) cin and cout when
outputting text to the screen.


Then they are not teaching you C, but rather C++. If you intend to
learn C++ then you should be reading/posting to comp.lang.c++
instead.

There is no iostream.h in C. There is no cin nor cout in C. The <<
and >> operators only ever mean 'shift left' and 'shift right'.

--
Simon.
Nov 13 '05 #2
"nullptr" <_invalid_@_invalid_.net> skrev i meddelandet
news:pan.2003.08.23.18.58.26.532336@_invalid_.net. ..
I think you are confuzing C++ with C. In C, the relevant cout/cin
counterparts are included in stdio.h.

--
nullptr


Oh, of course I am... I've been down both roads, but never got anywhere, so
I'm not surprised I would be mixing them together.

You wouldn't have any idea of what is happening with the C++-library then,
would you? (Might be good to know anyway, if i ever deal with C++ again).
Thanks for the answer.
Nov 13 '05 #3
Tim Cambrant wrote:
Hello, I'm relatively new to C, although I've touched the subject several
times for a couple of years. Tutorials etc. always taught me that I should
use (in the beginning at least) cin and cout when outputting text to the
screen.
The identifiers 'cin' and 'cout' have no defined meaning in C. They are in
the user's namespace and have no predefined relationship to input or output.

In the foul C++ language, these identifiers are defined in the 'std'
namespace, but without qualification are in the user's namespace and
unrelated to input or output, as in C.
Recently, when giving C another shot with the new GCC 3.3, I couldn't use
the functions defined in iostream.h anymore.


<iostream.h> is not a C or C++ header.
The C header is <stdio.h>.
The C++ headers are <iostream> and <cstream>.


--
Martin Ambuhl

Nov 13 '05 #4
"Martin Ambuhl" <ma*****@earthlink.net> skrev i meddelandet
news:lM***************@newsread1.news.atl.earthlin k.net...
Tim Cambrant wrote:
Hello, I'm relatively new to C, although I've touched the subject several times for a couple of years. Tutorials etc. always taught me that I should use (in the beginning at least) cin and cout when outputting text to the
screen.
The identifiers 'cin' and 'cout' have no defined meaning in C. They are

in the user's namespace and have no predefined relationship to input or output.
In the foul C++ language, these identifiers are defined in the 'std'
namespace, but without qualification are in the user's namespace and
unrelated to input or output, as in C.
Recently, when giving C another shot with the new GCC 3.3, I couldn't use the functions defined in iostream.h anymore.


<iostream.h> is not a C or C++ header.
The C header is <stdio.h>.
The C++ headers are <iostream> and <cstream>.


--
Martin Ambuhl


That clarifies it all somewhat. Thank you.
Nov 13 '05 #5
"Martin Ambuhl" <ma*****@earthlink.net> skrev i meddelandet
news:3F************@earthlink.net...
Tim Cambrant wrote:

[posted & e-mailed, in case Tim has stopped following this thread]
"Martin Ambuhl" <ma*****@earthlink.net> skrev i meddelandet
news:lM***************@newsread1.news.atl.earthlin k.net...

The C++ headers are <iostream> and <cstream>.


I'm sorry; I erred. The C++ headers are <iostream> and <cstdio>.
That clarifies it all somewhat. Thank you.


I hope this more correct version clarifies it a little more.

--
Martin Ambuhl


No problem, thanks for the new information :)
Nov 13 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Michael | last post by:
Dear All I have problem with my database server which running SQL server 2000. The server running very slow. The worst case, to save a record required more than 20-30 seconds. Since this...
18
by: Chris Travers | last post by:
Hi all; I have been looking into how to ensure that synchronous replication, etc. could best be implimented. To date, I see only two options: incorporate the replication code into the database...
2
by: seash | last post by:
hi I wrote a class like this.......in my application. public class cls { public static extern bool myApp ( ref string aa,
2
by: jason | last post by:
Pardon my ignorance on this. The below code works, except, when I edit a record and update the two drop downs take the first entry in the dropdownlist if not selected. I'd also like the dropdown to...
0
by: muntyanu | last post by:
Hi All, I need to find out current status of my monitor: is it OFF or ON ? I can set status by SendMessage(handle, WM_SYSCOMMAND, SC_MONITORPOWER, MONITOR_ON) But before setting status I have...
1
by: simbarashe | last post by:
Hie could someone please help me with getting and using the current page url. I have a function that gets the url, I want to use it with header(location : XXX) but it wont work. The code is as...
2
by: anonymouse | last post by:
Hi Guys, I'm hoping that you could help me out with my little problem. I'm using VB6 and trying to create a form with a status bar. I would like to show the current time in military format...
4
by: Tom Picket | last post by:
Hello, I'm relatively new to C, although I've touched the subject several times for a couple of years. Tutorials etc. always taught me that I should use (in the beginning at least) cin and cout...
0
by: shorti | last post by:
We are running DB2 UDB 8.1 fp 14 on AIX using archival logging and online backups. I was running some disaster tests and found my database restore was not restoring to the latest active log. ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.