Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
#include <iostream>
#include <string>
int main()
{
std::wstring widestring = L"Hello World.\n";
std::wstring::iterator pos = widestring.begin();
while (pos != widestring.end())
{
if (*pos == L'H')
*pos = L'J';
++pos;
}
std::wcout << widestring;
}
#include <climits>
unsigned char LowByte( wchar_t wc )
{
return static_cast<unsigned char>( wc );
}
unsigned char HighByte( wchar_t wc )
{
return static_cast<unsigned char>( wc >> ((sizeof(wchar_t) * CHAR_BIT) - CHAR_BIT) );
}
#include <iostream>
#include <algorithm>
#include <iterator>
#include <string>
#include <vector>
int main()
{
std::vector<unsigned char> messageText;
std::wstring messageContent(L"ABC");
// Get a pointer to the data:
const wchar_t* wstr_data = messageContent.data();
// Cast to an unsigned char*:
const unsigned char* uchar_data = reinterpret_cast<const unsigned char*>(wstr_data);
// Determine size of data:
unsigned int data_size = messageContent.size() * sizeof(wchar_t);
// Add to vector:
messageText.insert(messageText.end(), uchar_data, uchar_data + data_size);
// Prove the vector holds the data:
std::copy(messageText.begin(), messageText.end(), std::ostream_iterator<unsigned char>(std::cout, "\n"));
}