answersLogoWhite

0


Best Answer

A pointer is simply a variable that stores a memory address. Thus a pointer to an object is simply a variable that stores the memory address of an object. Since pointers are variables, they require memory of their own. Pointers may also be constant, which simply means you cannot change what they point to. Pointers can also be dereferenced to provide indirect access to the memory they point to -- hence they are known as pointers. However, unlike C, pointers are not the same as references. In C++, a reference is simply an alias for a memory address and requires no storage of its own.

User Avatar

Wiki User

10y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

You cannot point at a class. Pointers are defined by the class of object they can point at. An object is an instance of a class and the pointer points at the object, not the class.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is pointer to an object in c plus plus?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is 'this' pointer in c plus plus?

Address of the current object.


What is null object in c plus plus?

a pointer that is not pointing to anything


What is an address in C plus plus programming?

An address in C or C++ is the location in memory of an object or function. An address is the contents of a pointer, as opposed to the contents of the memory location pointed to by the pointer.


How this pointer works in C plus plus?

The "this" pointer is a pointer to the instance of the object, with scope within a member function of that object. It is not always necessary to use it, as references to variables defined in the object will be implicitly prefixed with "this->", but it can resolve name scoping problems, and it can make the code more readable.


What is called pointers-c plus plus?

Yes, C++ has pointers, which are references to memory locations. which are variables that store memory addresses, or NULL (zero). If the pointer is non-NULL, the pointer is said to dereference the object (or variable) residing at the stored memory address, which permits indirect access to that object so long as the object remains in scope.


What is Dazzling Pointer in c plus plus?

The pointer that points to a block of memory that does not exist is called a dazzling pointer or wild pointer


Call by reference using pointer in c plus plus?

Example: void foo( MyClass& object ){} // function with call by reference signature MyClass* p = new MyClass(); // instantiate a pointer to MyClass foo( *p ); // call by reference using the pointer


What does a - followed by a greater than symbol mean in a c plus plus program?

It is a type of pointer dereference operation. If you have a pointer p to an object that has methods or attributes, you can say (*p).m to refer to the m method of the object, or you can say p->m to do the exact same thing.


Is c plus plus an object orinted language?

Yes, it is object-oriented, but it is not 100% object-oriented because it supports the concept of primitive variables (which it inherits from C) such as char, int and bool, as well as pointer variables. In a 100% object-oriented language, these primitives would be implemented as objects, as they are in C# and Java. C++ is best described as a hybrid of procedural, structured and object-oriented programming paradigms.


What is 'this pointer' in regards to computer programming?

It is a pointer which is pointing to present object with which the memberfunction is called in c++ language.


What is the role of object in c plus plus?

An object in C++ is an instance of a C++ class.


Why does is used as a pointers in c language?

Let's suppose, you wanted to ask:Why thisis used as a pointer in C++ language? Because it is a pointer to the 'current object'.