Regarding de-referencing pointers.
So, I've been doing C++ for like 3 months now, and I wanted to dig deeper into pointers to finally understand them completely.
I'm familiar with what they are, and how they work, I just have this one question:
The last 2 lines, the FStrings, one is de-referencing the pointer. But I don't understand why the 2nd one works and what it's actually doing.
I really want to get this right. Could anyone please explain it to me?
Even if you are dereferencing your string is still making a copy in your scope, in the case you have you should have something like FString& StringA if you really want to capture the memory data, but in your case is anyway impossible since the info is transforming the vector to a string, this has to be allocated somewhere, the real example for this should be in two ways
FString* StringA = &SomeRealData; FString& StringA = SomeRealData;
just to anwser your question the last 2 lines are doing exactly the same.
answered Dec 06 '18 at 02:55 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here