Test function not working

Hello Eshwar,

The crash seems quite obvious; I did mention on one of your question that UE_LOG’s format is similar than printf hence %s expects a null-terminated string and not a character, pMessage in this case is a pointer to a TCHAR but * pMessage i.e. pMessage being dereferenced is the first character within that string, considering that W (ASCII) is equivalent to 87 in decimal and 0x57 in hex, you’re actually passing a pointer to memory address 0x57 assuming it’s non-readable/writable which seems like it isn’t in this case will cause a seg-fault. Remember that TCHAR* pMessage = _T( “World” ) declares a pointer to a TCHAR called pMessage and assigns it “World”, * pMessage however is not equivalent to pMessage, it’s equivalent to dereferencing pMessage and accessing the value in the base address of pMessage which in this case is W, likewise *( pMessage + 1 ) would be ‘o’ and would be accessing pMessage at it’s base address with a one byte offset due to the data-type. If however you wanted to print out the first letter of pMessage then you’d change the format to %c which would print the character.

As for FColor, you seem to be rather confused at that; FColor is simply a class just like FVector and declaring it assigns it’s members to a known value (assuming default assignment occurs). FColor has a few constructors and you can create a color by simply calling one of its constructor and passing it as argument to a function that expects an FColor.