Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is pointer past the end of an object means?

Tags:

People also ask

What is a pointer to an object?

A pointer is a type of variable that carries location information. In this case, the example variable will store the address of an Order object that we want to interact with. We initialize the pointer variable by using the C++ new operator to construct a new object of type Order.

What does a deleted pointer point to?

It doesn't point to anything. There is nothing useful you can do with its value now. Save this answer.

How do you set a pointer to the first element of an array?

To assign a pointer to the array we can use the following declaration... int a[10]; int *pa = &a[0]; Basically this assigns the memory address of a[0] the first element in array a to pointer of type int .


In C++ Primer, Chapter 2, "Variables and Basic Types", it says:

it is possible for a pointer to an object and a pointer one past the end of a different object to hold the same address.

I'm not a native speaker, and I think that's why I'm a bit confused by the sentence "a pointer one past the end of an object". Would anyone one tell me what it means please?