How can I convert an FString in to an unsigned char array?

ow do I write the value of an FString to an unsigned char array?

I’m trying to do something like:

FString unrealString = ustr;
unsigned char str[8];
unsigned char[] convertedFString = someConversion(ustr); 
memcpy(str, &convertedFString, sizeof(str));

What casting or converting is necessary to convert the FString into an unsigned char array?

FString is TCHAR array (which in most cases is regular char), you can access it by doing *ustr :

FString also have array features so you can use [] operator on it and make a C++11 for each loop.

Also for multi platfrom compability use function in FMemory: