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.
Printable View
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.
It is probably the ... Str(selected) ... term.
Is Str() a function ? some type of string variable ?
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;
}
Quote:
Originally Posted by Philip Nicoletti
yes it is a function....what muist be the problem???help!!!!!!
See the code provided by Smasher/Devourer's. It has the solution that you are seeking.
Thanks...you are all heaven's sent!