473,499 Members | 1,598 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

cout no operator matches these operands error

momotaro
357 Contributor
Hi,
am trying to output the value of a string variable like this:
Expand|Select|Wrap|Line Numbers
  1. cout<<"I am: " <<this->id <<endl;
the error is:
no operator matches these operands.

does it means that I have to overload the operator << ??

thank's in advance.
Jun 5 '11 #1
1 6457
weaknessforcats
9,208 Recognized Expert Moderator Expert
It looks like you have not included <string>.

Not all the string member functions are in <iostream>.
Jun 6 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
6968
by: Dave Bailey | last post by:
When running the following code: if (typeCheck.Checked == true && typeList.SelectedItem == "3") { return " and wopm3 = '3' or wopm3 = '3C' or wopm3 = '3I'"; } I get the following error: ...
2
5310
by: DouggieC | last post by:
Hi, I am attempting to overload the '<' operator in order to sort an array structure, but get a syntax error in Borland Builder5. Code as follows: struct GroupTeamType { AnsiString Name;...
3
1473
by: Pierre Barbier de Reuille | last post by:
Hi, after reading the article " The Standard Librarian : Defining Iterators and Const Iterators" from Matt Austern:...
0
1169
by: help1267 | last post by:
Hi, I'm getting the follwoing error when I try the following operation in *** C# ***: Error: Operator '^' cannot be applied to operands of type 'float' and 'int' Operation: fltNumber ^...
0
2030
by: erik.erikson | last post by:
I am getting a compiler error that I can't well explain or even understand the origin of (though I boiled it down close...). Below is a bare-bones example. What I am doing is defining the...
1
2743
by: amhoov | last post by:
Hi all, OS - MacOS X 10.4.9 Compiler - gcc 4.0 (XCode) I'm *extremely* new to C++ (but have extensive experience with Java), so please go easy on me. I'm running into a very odd situation...
1
1431
by: kalki70 | last post by:
Hello, I have a doubt about this operator, and I haven't found the answer in internet (yet). When calling the operator << several times in an expression, are all parameters evaluated first and...
4
3001
by: Ares Lagae | last post by:
How is an output stream operator of a class nested in a class template defined? The code fragment below does not compile. Maybe it's just me, but I don't see why it should not compile. Best...
1
2762
by: Terry Archer | last post by:
Error 1 error C2679: binary '>>' : no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion) #include <iostream> #include <fstream> #include...
3
6625
by: Brett Turner | last post by:
I am writing a client chat program, however every time I try to compile it, I get the same errors over and over... IntelliSense: no operator ">>" matches these operands WSAData wsaData;...
0
7171
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7220
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...
0
7386
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...
0
5468
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4918
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
4599
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
3098
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3090
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1427
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 ...

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.