Wednesday, May 30, 2007

C++: convert managed clr System::String^ to std::string

#include vcclr.h

System::String^ line = "a managed string";
pin_ptr wch = PtrToStringChars( line );
int len = (( line->Length+1) * 2);
char *ch = new char[ len ];
wcstombs( ch, wch, len );
string lineStr = ch;
delete ch;

Comparing smartwatches for adults (UK)

As I embark on my journey to choose my first standalone smartwatch to reduce my phone screen time, I've decided to invest in a standalon...