answersLogoWhite

0

The address-of operator is a unary operator which returns the address of its operand:

int x = 42; // instantiate a variable of type int

std::cout << "Value of x: " << x << std::endl; // e.g., 42

std::cout << "Address of x: " << &x << std::endl;

int* p = &x; // store the address of x in a pointer variable

std::cout << "Value of p: " << p << std::endl; // e.g., the address of x std::cout << "Address of p: " << &p << std::endl;

std::cout << "Value referred to by p: " << *p << std::endl; // e.g., 42

User Avatar

Wiki User

7y ago

What else can I help you with?

Related Questions

What is the operator that cannot be overloaded in c plus plus and java?

conditional operator , size of operator , membership operator and scope resulation operator can not be overload in c++


What is the operator is used to allocate the memory in c plus plus?

calloc operator,malloc operator


What is the operator of power in c plus plus?

There is no "power" operator in C or C++. You need to the use the math library function pow().


Example of binaray operator in c plus plus?

+ is an example, one of many, of a binary operator in C or C++ a = b + c; // for usage example


What is the memory management operator in c plus plus?

There is no memory management operator in C++ -- it is an unmanaged language. You use the C++ new operator to allocate memory, and use the C++ delete operator to release previously allocated memory.


When do we use an address operator in c'?

In C we use &amp; operator while giving address of some variable to some pointer variable. &amp; operator is also used in scanf().


Why are there 2 plus sign in c plus plus and Why not a single plus sign?

In C and in C++, the ++ operator means to increment. C++ was intended to be the next version, i.e. the incremental next step, of C, hence the use of the ++ operator.


What do the two plus stand for in C plus plus?

The ++ in C++ refers to the postfix increment operator (operator++()). It's literal meaning is "the successor to C", in reference to the C language upon which the C++ language is based.


Can the scope resolution operator be overloaded in C plus plus?

No.


Which operator is used for deallocating memory in c plus plus?

delete


Which operator cannot be overloaded c plus plus?

comma (,) is an example


How unary minus can be overload in c plus plus?

type operator- ();