#include <iostream>
int t[] = { 1, 2, 3, 4, 5 };
int main()
{
int *p = t;
std::cout << "t = " << std::hex << t << std::endl; // 0x404010
std::cout << "p = " << std::hex << p << std::endl; // 0x404010
std::cout << "sizeof(t) = " << sizeof(t) << std::endl; // 14 (impl. dependant)
std::cout << "sizeof(p) = " << sizeof(p) << std::endl; // 8 (impl. dependant)
std::cout << "t[2] = " << t[2] << std::endl; // ok: 3
std::cout << "p[2] = " << p[2] << std::endl; // ok: 3
++p; // ok, p can be lvalue
//++t; // syntax error, t cannot be lvalue
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKaW50IHRbXSA9IHsgMSwgMiwgMywgNCwgNSB9OwoKaW50IG1haW4oKQp7CiAgaW50ICpwID0gdDsKICAKICBzdGQ6OmNvdXQgPDwgInQgPSAiIDw8IHN0ZDo6aGV4IDw8IHQgPDwgc3RkOjplbmRsOyAgICAgIC8vIDB4NDA0MDEwCiAgc3RkOjpjb3V0IDw8ICJwID0gIiA8PCBzdGQ6OmhleCA8PCBwIDw8IHN0ZDo6ZW5kbDsgICAgICAvLyAweDQwNDAxMAogIHN0ZDo6Y291dCA8PCAic2l6ZW9mKHQpID0gIiA8PCBzaXplb2YodCkgPDwgc3RkOjplbmRsOyAgLy8gMTQgKGltcGwuIGRlcGVuZGFudCkKICBzdGQ6OmNvdXQgPDwgInNpemVvZihwKSA9ICIgPDwgc2l6ZW9mKHApIDw8IHN0ZDo6ZW5kbDsgIC8vIDggIChpbXBsLiBkZXBlbmRhbnQpCiAgc3RkOjpjb3V0IDw8ICJ0WzJdID0gIiA8PCB0WzJdIDw8IHN0ZDo6ZW5kbDsgICAgICAgICAgICAvLyBvazogMwogIHN0ZDo6Y291dCA8PCAicFsyXSA9ICIgPDwgcFsyXSA8PCBzdGQ6OmVuZGw7ICAgICAgICAgICAgLy8gb2s6IDMKICAKICArK3A7ICAvLyBvaywgcCBjYW4gYmUgbHZhbHVlCiAgLy8rK3Q7ICAvLyBzeW50YXggZXJyb3IsIHQgY2Fubm90IGJlIGx2YWx1ZQoKICByZXR1cm4gMDsKfQ==