A variable that points to an address in memory.
Pointers can be initialized outright or created for an existing variable.
char var1 = "Hello";
pointer1 = *var1;
char *pointer2 = "Hello"
Then, the following will print the same output:
printf("%s", var1);
printf("%s", pointer1);
printf("%s", pointer2);
Since memory is deleted at the end of an objects life, you need to be careful passing values to pointers in C++.
Notes on Computers
AWS · Bash · C · C++ · Cyber Security · Git · LaTeX · Linux · Networking · Python · Raspberry Pi · Tools · Vim
Notes on Math & Physics
Information Theory · Linear Algebra · Solid State Physics
Copyright 2021 · Eric D. Weise