|
-
Dec 15th, 2002, 11:00 AM
#1
Thread Starter
Fanatic Member
What is wrong? :(
Code:
#include <iostream.h>
#include <string>
using namespace std;
int main(){
string string1 = "hello";
cout << string1 << '\n';
return 0;
}
I get the error:
error C2679: binary '<<' : no operator defined which takes a right-hand operand of type 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' (or there is no acceptabl
e conversion)
why?
-
Dec 15th, 2002, 11:30 AM
#2
Monday Morning Lunatic
You need to use <iostream>, not <iostream.h>. <iostream.h> is the older, non-standard, deprecated version of the stream libraries
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Dec 15th, 2002, 01:23 PM
#3
Thread Starter
Fanatic Member
heh, thanks
-
Dec 15th, 2002, 07:08 PM
#4
not-anymore-standard
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|