Two pointers of various information are stored

Is it true that:

int* p = new int;

and

int* p1 = new int[5]();

in case of p1 will additional information be saved?

+3
source share
2 answers

Yes, may be.

I recommend you read the following elements from C ++ - faq:

Corresponding quote extracted from the first link:

The runtime system stores the number of objects, n, where it is possible to obtain, if you only know the pointer, s. There are two popular methods that do this. [...]

  • n Fred.
  • p n
+3
+3

Source: https://habr.com/ru/post/1779826/


All Articles