As someone who is quite new to c++, and how it’s handling references to vars etc… what is going on?
I assume SanitizeFloat() is dereferencing the variable so I’m allowed to access it…?
I apologise for such a dumb question, just wasn’t sure what to google to understand this better (is it how UE4’s functions work or is it more of a basic c++ understanding)
UE_LOG is a macro. Macros isn’t type safe and you need to use them carefully. %s means: replace it with c-string. No mather what you pass - it will be treated as a char array.
Float value is trated like null-terminated char array, so it tries to access subsequent bytes until it encounters null byte. You don’t know where that null byte is, so you end up with a memory access violation because you’re trying to get into memory that doesn’t belong to you = crash.