C++, does * work as a char variable? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

C++, does * work as a char variable?

In C++, does * work as a char variable?

14th Oct 2019, 4:07 AM
Randi Bolt
Randi Bolt - avatar
1 Answer
+ 2
When a “normal variable” is declared, memory is claimed for that variable. Let’s say you declare an integer variable MYVAR. Four bytes of memory is set aside for that variable. The location in memory is known by the name MYVAR. At the machine level that location has a memory address. A pointer differs in the way that a pointer is a variable that points to another variable. A pointer holds the memory address of that variable. That variable contains a value. Pointers are also called address variables because they contain the addresses of other variables
16th Oct 2019, 3:52 PM
Роман Львов
Роман Львов - avatar