万恶的指针...
程序代码:
#include <stdio.h> #include <stdlib.h> int main() { int i; int *address = (int *) malloc(sizeof(int) * 5); printf ("The first address of the system to allocate space:%p\n",address); for (i = 0;i < 5;i++) { printf ("%p---->",address+i); scanf ("%d",address+i); } for (i = 0;i < 5;i++) { printf ("---->%d\n",*(address+i)); //我的问题是为什么前面加 * } return 0; }