char str[10];
HRESULT hr;
hr = StringCbCopy(str, sizeof(str), "hello");
if (SUCCEEDED(hr)) puts(str);

Example 3: The safer version of the string copy.

Back to Article