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. 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.
"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.
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
"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.
"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 :) This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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...
|
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,
|
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...
|
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...
|
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...
|
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...
|
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...
|
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. ...
|
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...
|
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...
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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,...
|
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...
|
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...
| |