+ 1
What is use of * asterisk operator in pointer
2 Respostas
+ 1
* is used to create pointers or used as the dereference operator which basically grabs the value of the memory location it is pointing to. Like
int var = 70;
int *ptr = &var;
cout << ptr << endl; // prints var memory location
cout << *ptr << endl; // prints 70 (var's value)
+ 1
thank you