I need to send a fomatted data to a tcp ip port in my c++/cli program.I have this code with no success
String^ data;
sprintf(data,"L,%02u%02u%02u%02u%02u%02u%03u,%lf %lf\n",rDateTime.uiYear, rDateTime.usiMonth, rDateTime.usiDay,
rDateTime.usiHour, rDateTime.usiMinute, rDateTime.usiSec,
rDateTime.udiUSec / 1000,container[i].first,container[i].second);
I get the error *error C2664: 'sprintf' : cannot convert parameter 1 from 'System::String ^' to char **
I want to write it to a string variable std::string.
Can someone provide with some suggestions.If atleast I convert it to System::String^. I can convert it to the std:string using this C++/CLI Converting from System::String^ to std::string. But I dont know how to write the different datatypes to a string^ in c++/cli..