b*****n 发帖数: 2324 | 1 我一直以为是一样的,谁能说说有什么区别?
疑难问题一并问了。 | s********s 发帖数: 4011 | 2 copy from comp.lang.c FAQ list, u can see more there.
An array is a single, preallocated chunk of contiguous elements (all of the
same type), fixed in size and location. A pointer is a reference to any data
element (of a particular type) anywhere. A pointer must be assigned to
point to space allocated elsewhere, but it can be reassigned (and the space,
if derived from malloc, can be resized) at any time. A pointer can point to
an array, and can simulate (along with malloc) a dynamically allocate | b*****n 发帖数: 2324 | | O*******d 发帖数: 20343 | 4 你可以用sizeof看看char[8]和char*的大小. |
|