OT: C++ Question

H.S. hs.samix at gmail.com
Thu Mar 12 21:25:39 UTC 2009


Karl Larsen wrote:
> 
> karl at cheap-laptop:~/cplus$ g++ ex75.c
> ex75.c: In function ‘int main()’:
> ex75.c:24: error: no match for ‘operator<<’ in ‘std::cin << feet’
> karl at cheap-laptop:~/cplus$
> 
> 
> 
> As you can see the little c++ example from the book does not compile. I 
> added the (line 24) so you readers can see what line the g++ compiler 
> see's an error. I simply can't see the error and so need some help.
> 
> Your welcome to try it on your Linux and I hope you do.


statement should be:
cn >> feet ...

Moreover, your example you gave about does not compile anyway. I get:
$> g++ -Wall foo.c -o foo
foo.c: In function ‘int main()’:
foo.c:19: error: ‘line’ was not declared in this scope
foo.c:19: error: expected `)' before numeric constant


Fix that. Try again.

Advice: use the usual c++ source code file extensions for c++ source
code (cc, cpp, c++, etc.).






-- 

Please reply to this list only. I read this list on its corresponding
newsgroup on gmane.org. Replies sent to my email address are just
filtered to a folder in my mailbox and get periodically deleted without
ever having been read.





More information about the ubuntu-users mailing list