The difference between a pointer and array name

指针和数组名的区别

主要是有三点

  1. 首先是声明一个数组的时候,数组名是作为数组的初始化名的
  2. 使用sizeof()的时候,对于数组名来说返回的是一个整个数组的字节数
  3. &arrname返回的是一个指向整个数组的指针。

常指针和普通指针的注意点

const type pointer can point to const data type and non-const data type; However a normal pointer cannot point to a const because if so it means that you can change the value of a const through the normal pointer. But there is a trick that you cannot assign the value of a normal pointer to a const type pointer to pointer because this kind of pointer to pointer end up pointing to a const value,but once you point to a normal pointer,you can change the value of this const data.

你可能感兴趣的:(The difference between a pointer and array name)