typedef struct abc{
int a;
char b;
}abc;
typedef abc bkl[1];
.
.
.
blk b;
b=shmat(shmid, NULL, 0); //This error that (Void *) to blk
//But anyway blk is pointer,it isnt ?
blk *b;
b=shmat(shmid, NULL, 0); //This is correct, why? b pointor to pointer
感谢。
答案 0 :(得分:4)
blk b;
与:
相同abc b[1];
b
在您使用它的意义上不是指针。
b = shmat(shmid, NULL, 0);
不正确,因为您无法指定指向数组的指针。这完全是以下错误的方式。
int arr[3];
arr = malloc(sizeof(int)*10);