#include <iostream>
int main ( )
{
constexpr int N = 5 ;
int numbers[ N] = { 0 } ;
std:: cout << N << " elements of array numbers are located at:\n \t " ;
for ( int i= 0 ; i< N ; ++ i ) std:: cout << & numbers[ i] << ' ' ;
std:: cout << '\n ' ;
int * p = nullptr ;
p = numbers ;
std:: cout << "after p = numbers, pointer p points to address: " << p << '\n ' ;
* p = 10 ;
++ p ;
std:: cout << "after ++p, p points to address: " << p << '\n ' ;
* p = 20 ;
p = & numbers[ 2 ] ;
std:: cout << "after p = &numbers[2], p points to address: " << p << '\n ' ;
* p = 30 ;
p = numbers + 3 ;
std:: cout << "after p = numbers+3, p points to address: " << p << '\n ' ;
* p = 40 ;
p = numbers;
std:: cout << "after p = numbers, p points to address: " << p << '\n ' ;
std:: cout << "(p+4) points to address: " << p+ 4 << '\n ' ;
* ( p+ 4 ) = 50 ;
for ( int v : numbers ) std:: cout << v << ' ' ;
std:: cout << '\n ' ;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKaW50IG1haW4gKCkKewogICAgY29uc3RleHByIGludCBOID0gNSA7CiAgICBpbnQgbnVtYmVyc1tOXSA9IHswfSA7CgogICAgc3RkOjpjb3V0IDw8IE4gPDwgIiBlbGVtZW50cyBvZiBhcnJheSBudW1iZXJzIGFyZSBsb2NhdGVkIGF0OlxuXHQiIDsKICAgIGZvciggaW50IGk9MCA7IGk8TiA7ICsraSApIHN0ZDo6Y291dCA8PCAmbnVtYmVyc1tpXSA8PCAnICcgOwogICAgc3RkOjpjb3V0IDw8ICdcbicgOwoKICAgIGludCogcCA9IG51bGxwdHIgOwogICAgcCA9IG51bWJlcnMgOwogICAgc3RkOjpjb3V0IDw8ICJhZnRlciBwID0gbnVtYmVycywgcG9pbnRlciBwIHBvaW50cyB0byBhZGRyZXNzOiAiIDw8IHAgPDwgJ1xuJyA7CiAgICAqcCA9IDEwOwoKICAgICsrcCA7CiAgICBzdGQ6OmNvdXQgPDwgImFmdGVyICsrcCwgcCBwb2ludHMgdG8gYWRk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