Quote:
Originariamente inviato da _Claudio
oss << n
Significa prendi n e copialo sullo stream oss.
Il codice completo è:
Codice:
#include <sstream>
System::String^ inttoString(int n) {
ostringstream oss;
oss << n;
return gcnew System::String(oss.str().c_str());
}
|
Perchè mai usare il C++/CLI?
Codice:
template <class T> std::string ToString(T & t)
{
stringstream s;
s << t;
return s.str();
}