|
-
October 12th, 2005, 09:36 PM
#1
error C2064: term does not evaluate to a function
Hi...everyone...i got this error when i build my project....(error C2064: term does not evaluate to a function) and it points to this part of my code:
sMsg = "Delete " + Str(selected) + " selected item(s)?";
Thanks.
-
October 12th, 2005, 09:48 PM
#2
Re: error C2064: term does not evaluate to a function
It is probably the ... Str(selected) ... term.
Is Str() a function ? some type of string variable ?
-
October 12th, 2005, 09:54 PM
#3
Re: error C2064: term does not evaluate to a function
Str() is a function that converts a numeric type to a string, but in Visual Basic, not C++. If you want to put different types together into a std::string in C++, one easy way is to use a stringstream, like so:
Code:
#include <iostream>
#include <sstream>
using namespace std;
int main()
{
int selected = 4;
ostringstream MessageStream;
string Message;
MessageStream << "Delete " << selected << " selected item(s)?";
Message = MessageStream.str();
cout << Message << endl; // OUTPUT: Delete 4 selected item(s)?
return 0;
}
-
October 12th, 2005, 11:10 PM
#4
Re: error C2064: term does not evaluate to a function
 Originally Posted by Philip Nicoletti
It is probably the ... Str(selected) ... term.
Is Str() a function ? some type of string variable ?
yes it is a function....what muist be the problem???help!!!!!!
-
October 12th, 2005, 11:51 PM
#5
Re: error C2064: term does not evaluate to a function
See the code provided by Smasher/Devourer's. It has the solution that you are seeking.
-
October 13th, 2005, 01:02 AM
#6
Re: error C2064: term does not evaluate to a function
Thanks...you are all heaven's sent!
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
|