What is Pointer operator * in C++?
Answers
Answered by
1
pointer operator(*):
- pointer operator is also called deference operator.
- it is used to find the value at address operator.
declaration:
int * variablename;
example:
int*ptr;
karanshah22223333:
hiii
Answered by
0
Pointer operator are those that will hold the address of variable of same datatype .
Explanation:
- The pointer is variable that holds the address of the variable of the same datatype .we can use * to denoted the pointer. Following are the syntax to declared any pointer.
- datatype *variable _name;
For example :
int *s;
- Here s is a pointer that will hold the address of another variable i.e is of int type.
- we can use * to print the value of the pointer .
Program:
include <iostream> // header file
using namespace std; // namespace
int main() // main function
{
int *s1, num=1031; // variable declartion
s1= # // pointer points the variable num
cout<<"Address of num by using pointer: "<<s1<<endl;
cout<<"Address of s1: "<<&s1<<endl;
cout<<"Value of num: "<<*s1;
return 0;
}
Learn More:
- https://brainly.in/question/11682970
Similar questions