Computer Science, asked by traptigupta7419, 1 year ago

What is Pointer operator * in C++?

Answers

Answered by artisharma47
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
karanshah22223333: what are you doing
karanshah22223333: what is your name
Answered by StaceeLichtenstein
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= &num; // 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