I've been learning coding for quite a while now but still cannot understand References and Pointers. Every answer I've searched is way too complicated for me.
When we're calling a variable to be used, for example
int32 y = 1;
int32 x = 2;
int32 z = y + x;
1) What exactly is happening in "z"? Is it calling "y" and "x" by reference, by pointer or just calling them by variable?
In this code I'm currently learning
FString Log = TEXT("Hello");
FString* PrtLog = &Log;
Log.Len();
(*PrtLog).Len();
PrtLog->Len();
2) What is going on here? Is "PrtLog" a reference or a pointer?
3) The lecturer said *PrtLog is "dereferencing" PrtLog. Does that mean the reference for PrtLog is removed? Whats the difference between * and ->
4) Why do we even need a reference or a pointer if calling a variable is just as fine?
5) Why do some people claim 90% of variables will be using references and pointers in higher levels? Are they beneficial in any way? If we just call by variable, isn't it simpler and faster?
Sorry if this is too many questions. I can't get an answer I'm able to understand anywhere on references and pointers so I'm really confused.