Thread: String Library
View Single Post
Old 03-15-2003, 01:53 PM   #13 (permalink)
MacTool
Registered User
 
MacTool's Avatar
 
Join Date: Mar 2003
Location: Home.
Posts: 5
MacTool is on a distinguished road
Indeed. Interesting note, however.

#include <iostream>
#include <string>

using namespace std;

string test="abc";

int main(void)
{
return 0;
}


This code compiles. However, if I try to cout test, it says no go.
I added the line cout << test << endl; before the return 0. This is what I got :

C:\Fee's\C++\junk.cpp(9) : 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 acceptable conversion)

Any guesses?

Thanks so far fer all yer help.
MacTool is offline   Reply With Quote