473,474 Members | 1,304 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Currant 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.
Dec 21 '07 #1
4 1472
On Dec 21, 12:59*pm, Tom Picket <t...@spam.me.notwrote:
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.
The include <iostreamis part of C++ and not part of C. If you
include <iostreamyou no longer have a C program, but a C++ program.
The standard C++ header files do not use .h as part of the extension.
So <iostream.his an error. Also be aware that you now have to
qualify objects with the standard namespace.
Try news comp.lang.c++ for more information.
Follow-ups set.
Dec 21 '07 #2
Tom Picket wrote, On 21/12/07 20:59:
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.
In that case they were not C tutorials, they were probably C++ tutorials.
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
<snip>

iostream.h was never part of C either.

I suggest you work out whether you want C or C++. If you want C++ then
this is the wrong place, but comp.lang.c++ is not far away. If you want
C then you need to start again since that is not what you have been
learning.
--
Flash Gordon
Dec 21 '07 #3
Tom Picket 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.
Neither "cin" nor "cout" have any defined meaning 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.
There is no such header as iostream.h in C. Nor, for that matter, is
there one in C++, which _does_ have <iostream>.

I believe you are confused about what language you are using. The
similarity of "C" and "C++" probably misled you; otherwise you might
have asked in comp.lang.fortran.
Dec 21 '07 #4
Tom Picket 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.
You are confused. There is no cin, cout, iostream.h, etc. in C.
Those things exist in that unmentioned (here in c.l.c) language
C++. It may be discussed in comp.lang.c++.

However, if you want to use C (which is an admirable objective),
get used to such functions as getc, putc, etc. There are many such
extant. Get the 2nd edition of the C language book, by Kernighan &
Ritchie. Read it.

--
Merry Christmas, Happy Hanukah, Happy New Year
Joyeux Noel, Bonne Annee.
Chuck F (cbfalconer at maineline dot net)
<http://cbfalconer.home.att.net>
--
Posted via a free Usenet account from http://www.teranews.com

Dec 21 '07 #5

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

Similar topics

10
by: John Tiger | last post by:
Can anybody have idea about the difference between #include <iostream.h> and #include <iostream>. Is later one valid statement on any compiler. I tried compiling on MSVC second statement give...
13
by: ncstate | last post by:
it seems when i try to compile this simple code I get an error message i believe is from g++ not finding the IOSTREAM header file. i found the header file in /usr/include/c++/3.2.2/ so that is why...
19
by: ernst.stiegler | last post by:
Hello, I just want to read a whole line from a console input. What I don't understand is that I always have to press ENTER twice in order to see the line I've entered. Here's my code : ...
1
by: Pradyot Dhulipala | last post by:
Hi, I am using ns2.26 with the Makefile using C++ compiler version c++ (GCC) 3.2.2 (Mandrake Linux 9.1 3.2.2-3mdk). When I use iostream.h in a simple program and compile with c++ everything works...
2
by: humble04 | last post by:
Hi, I am compiling a collection of C++ code. Most of them are using the new format #include <iostream>. I think all of them because I failed at finding out which header file uses the old format ...
7
by: S. Nurbe | last post by:
Hi, probably this is a common problem but I couldn't find yet a proper solution (and I hope there is one). I have two relative complex frameworks: one uses only iostream.h the other one only...
5
by: Tim Cambrant | 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...
63
by: Martin Johansen | last post by:
Hey guys Since C is my language of choice for almost any kind of application, I'd like to know what the status of C is around the world today. And I am ofcourse not talking about C++ or C#. I...
1
by: Shane Ragone | last post by:
What happened to iostream.h in VS .NET? Are we now to code: #include <iostream> instead of: #include <iostream.h> All my past code that used iostream.h will no longer
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.