Message from C, C++ talks

June 2019

— Can u tell me what this code does

— It won't even compile., since object isnt declared

— If it was, however, it would get the pointer of object

— And store it in ptr

— 

Pointer points to an address of object in memory, in some cases that you don’t have to copy it or whatever

— Copy wt

— Guess it

— The value of the variable

— String a = "!kölaksdjfölaksdjf öasdkjf öklJ"

string b = a;

— String a will be completely copied into string b

— Ströng a;

— If you do

string* b = &a; (the pointer b points to string a)

you don'T copy whats IN the string but WHERE to find the content of the string

Message permanent page

— Like copying a string with copy paste is very hard

— Yea

— Instead, you just remember where the string is