However, most likely, the putText like functions, prefer "string" as the input type. Then how are we going to convert the digital (int/double) data type to string, is a small but important question.
In Matlab:
str = ['PersonId ' num2str(id)];
In C++
#include <iostream>
#include <sstream>
using namespace std;
int main(int argc, char *argv[]) {
std::ostringstream convert;
int id = 5;
string txt;
convert << id;
txt = "PersonId " + convert.str();
cout << txt << endl;
return 0;
}
No comments:
Post a Comment