Talk About Network

Google





Programming > C - C++ Learning > Re: Total Newbi...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 53 Topic 4060 of 4400
Post > Topic >>

Re: Total Newbie Backward Compat Question

by Hal Vaughan <hal@[EMAIL PROTECTED] > Mar 10, 2008 at 05:49 AM

Richard Heathfield wrote:

> Hal Vaughan said:
> 
> <snip>
>  
>> In file included from /usr/include/c++/4.1.3/backward/iostream.h:31,
>>                  from testtcp.cpp:1:
>> /usr/include/c++/4.1.3/backward/backward_warning.h:32:2: warning:
>> #warning This file includes at least one deprecated or antiquated
header.
> 
> Yes, you're looking at least ten years into the past.

When you said that I checked the copyright date on this book.  1995.  And
I
got it from a friend who said it would be quite helpful.  I'll have to
talk
to him about this when I see him next.

> <snip>
>  
>> I understand that so I changed the line to "#include <iostream>"
> 
> Good.
> 
>> and I
>> get this error:
>> 
>> testtcp.cpp: In function ?int main()?:
>> testtcp.cpp:4: error: ?cout? was not declared in this scope
>> 
>> So I've changed the include statement to the format the compiler asks
for
>> and suddenly it doesn't even include iostream.
> 
> I think you misinterpreted the message.
> 
> Assuming you *HAD* this:
> 
> #include <iostream.h> /* deprecated */
> int main(void)
> {
>   cout << "Hello, world" << endl;
>   return 0;
> }
> 
> you need to change it *TO* this:
> 
> #include <iostream>
> int main(void)
> {
>   std::cout << "Hello, world" << std::endl;
>   return 0;
> }

So the std:: is specifying the namespace where the function cout is and
I'm
also adding an eol character as well, right?

> 
>> Am I doing something wrong
>> or is something not working right?  I've tried searching some of the
>> terms (like "backward_warning") and it's given me some FAQs but nothing
>> that is helpful.
> 
> The search tearm you are looking for is "namespace". Not exactly
obvious,
> is it?

No, it isn't.  And from what I saw on your example, that tells me that my
source is not just old, but way off and I'll need more info on what is in
what namespace.  In other words it's not a quick, simple fix, there's a
new
issue I need to understand.  (I'm used to dealing with namespace, but
there
wasn't enough to tell me that was the issue and it's clear I have to learn
what's in what namespace in C++ now.)
 
>> I'm sure this is one of those questions that, after a day of
>> using C++, I'll look at as completely blind, but for now I just can't
see
>> what is wrong here.
> 
> Yeah, when you know, it's easy - but when you don't...

Thanks.  It's pointed me into a whole new area I need to explore.

Hal
 




 53 Posts in Topic:
Total Newbie Backward Compat Question
Hal Vaughan <hal@[EMAI  2008-03-10 05:38:03 
Re: Total Newbie Backward Compat Question
Richard Heathfield <rj  2008-03-10 05:48:22 
Re: Total Newbie Backward Compat Question
Hal Vaughan <hal@[EMAI  2008-03-10 05:49:42 
Re: Total Newbie Backward Compat Question
Richard Heathfield <rj  2008-03-10 06:24:13 
Re: Total Newbie Backward Compat Question
Hal Vaughan <hal@[EMAI  2008-03-11 14:35:17 
Re: Total Newbie Backward Compat Question
Crazy c <chrisNchrist@  2008-03-10 04:12:17 
Re: Total Newbie Backward Compat Question
Richard Heathfield <rj  2008-03-10 12:05:13 
Re: Total Newbie Backward Compat Question
"Daniel T." <  2008-03-11 06:37:11 
Re: Total Newbie Backward Compat Question
"Chris ( Val )"  2008-03-10 06:15:26 
Re: Total Newbie Backward Compat Question
Richard Heathfield <rj  2008-03-10 14:21:14 
Re: Total Newbie Backward Compat Question
"Chris ( Val )"  2008-03-11 02:15:39 
Re: Total Newbie Backward Compat Question
Richard Heathfield <rj  2008-03-11 10:29:42 
Re: Total Newbie Backward Compat Question
Bart van Ingen Schenau &l  2008-03-11 18:58:25 
Re: Total Newbie Backward Compat Question
"Daniel T." <  2008-03-12 06:26:50 
Re: Total Newbie Backward Compat Question
Bart van Ingen Schenau &l  2008-03-12 17:43:08 
Re: Total Newbie Backward Compat Question
"Chris ( Val )"  2008-03-11 04:21:32 
Re: Total Newbie Backward Compat Question
Richard Heathfield <rj  2008-03-11 14:56:52 
Re: Total Newbie Backward Compat Question
Anand Hariharan <mailt  2008-03-11 19:31:54 
Re: Total Newbie Backward Compat Question
"Chris ( Val )"  2008-03-12 06:15:16 
Re: Total Newbie Backward Compat Question
"Chris ( Val )"  2008-03-12 06:19:55 
Re: Total Newbie Backward Compat Question
"Chris ( Val )"  2008-03-12 06:27:42 
Re: Total Newbie Backward Compat Question
"Chris ( Val )"  2008-03-12 06:54:16 
Re: Total Newbie Backward Compat Question
Bart van Ingen Schenau &l  2008-03-12 18:40:28 
Re: Total Newbie Backward Compat Question
"Chris ( Val )"  2008-03-12 07:10:18 
Re: Total Newbie Backward Compat Question
Richard Heathfield <rj  2008-03-12 14:28:48 
Re: Total Newbie Backward Compat Question
Hal Vaughan <hal@[EMAI  2008-03-13 05:43:14 
Re: Total Newbie Backward Compat Question
Richard Heathfield <rj  2008-03-13 07:11:42 
Re: Total Newbie Backward Compat Question
Jerry Coffin <jcoffin@  2008-03-14 00:25:02 
Re: Total Newbie Backward Compat Question
Hal Vaughan <hal@[EMAI  2008-03-13 03:23:30 
Re: Total Newbie Backward Compat Question
Philip Potter <pgp@[EM  2008-03-13 15:57:05 
Re: Total Newbie Backward Compat Question
"Daniel T." <  2008-03-12 11:46:58 
Re: Total Newbie Backward Compat Question
Bart van Ingen Schenau &l  2008-03-14 21:34:35 
Re: Total Newbie Backward Compat Question
"Daniel T." <  2008-03-14 22:01:32 
Re: Total Newbie Backward Compat Question
Francis Glassborow <fr  2008-03-15 10:02:29 
Re: Total Newbie Backward Compat Question
Anand Hariharan <mailt  2008-03-12 18:36:13 
Re: Total Newbie Backward Compat Question
"Daniel T." <  2008-03-13 06:52:53 
Re: Total Newbie Backward Compat Question
Anand Hariharan <mailt  2008-03-12 23:36:10 
Re: Total Newbie Backward Compat Question
Micah Cowan <micah@[EM  2008-03-14 09:40:31 
Re: Total Newbie Backward Compat Question
"Daniel T." <  2008-03-13 10:23:19 
Re: Total Newbie Backward Compat Question
Bart van Ingen Schenau &l  2008-03-14 21:45:47 
Re: Total Newbie Backward Compat Question
"Daniel T." <  2008-03-15 07:14:33 
Re: Total Newbie Backward Compat Question
Francis Glassborow <fr  2008-03-15 16:14:23 
Re: Total Newbie Backward Compat Question
"Daniel T." <  2008-03-16 09:37:37 
Re: Total Newbie Backward Compat Question
"Chris ( Val )"  2008-03-18 05:04:15 
Re: Total Newbie Backward Compat Question
"Chris ( Val )"  2008-03-18 05:40:29 
Re: Total Newbie Backward Compat Question
Richard Heathfield <rj  2008-03-18 22:54:23 
Re: Total Newbie Backward Compat Question
"Chris ( Val )"  2008-03-18 07:12:06 
Re: Total Newbie Backward Compat Question
"Chris ( Val )"  2008-03-21 05:44:42 
Re: Total Newbie Backward Compat Question
Richard Heathfield <rj  2008-03-21 13:34:56 
Re: Total Newbie Backward Compat Question
Ben Bacarisse <ben.use  2008-03-12 18:05:26 
Re: Total Newbie Backward Compat Question
"Daniel T." <  2008-03-12 20:46:50 
Re: Total Newbie Backward Compat Question
Ben Bacarisse <ben.use  2008-03-13 01:57:08 
Re: Total Newbie Backward Compat Question
Ben Bacarisse <ben.use  2008-03-13 18:54:38 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Wed Jan 7 11:41:00 PST 2009.