Hi friend! I’m only learning also. I think the difference between FString, float, and void, is that these are different types of declarations.
FString String = “Text String Goes Here” ← This would be a way to declare a variable that is has the type of FString with the name of String. Then, the value of the variable is able to be filled by text, rather than numbers or a different type of information. An FString type of variable refers to a type of variable that is a string, or a line of text.
A float’s type is a number that has a decimal place, so it can be used in complex math. An example of a float is 1.1, because there is a decimal place in the numbers. A float can be 1.0 or 1.1, but would not be 1 or 2. 1 and 2 are called integers, since they don’t have a decimal point. Integers in Unreal C++ are variables of type int32.
float ThisNumber = 5.0f <---- This would be a way to declare a variable with type of float and the name of ThisNumber, and set the number to 5.0 to start.
Those all refer to types of variables, but the word void refers to a type of function.
It is used when you are declaring that a function is not going to return a different type of variable. Some functions are run in order to return something. Functions can return FStrings, floats, integers, and more, but don’t necessarily have to. If we are declaring a function that is not going to return something, which is often the case, we declare it with the word void.
void MyFunction() <— This would be a way of declaring a function that would not return anthing.
bool MyFunction() <— This would be a way of declaring a function that would return a boolean.
float MyFunction() <---- This would be a way of declaring a function that would return a float.
I hope this helps,
Cheers,
Tele