一元'*'的无效类型参数(有'int')

Nat*_*nes 1 c gcc pointers

我正在为C科学家和工程师解决以下的作业问题:

Given the following declarations and assignments, what do these expressions evaluate to?

int a1[10] = {9,8,7,6,5,4,3,2,1}
int *p1, *p2;
p1 = a1+3;
Line 14: p2 = *a1[2];
Run Code Online (Sandbox Code Playgroud)

我正在尝试使用gcc编译此代码,但是当我这样做时,它会给我以下错误:

w03_3_prob15.c: In function 'main':
w03_3_prob15.c:14:7: error: invalid type argument of unary '*' (have 'int')
Run Code Online (Sandbox Code Playgroud)

我正在使用以下命令进行编译:

gcc -o w03_3_prob15 w03_3_prob15.c -std=c99
Run Code Online (Sandbox Code Playgroud)

我真的不知道该怎么做.您对如何解决此错误有任何想法吗?

shf*_*301 7

该行无法编译,因为它在本书中不正确.来自作者的勘误表页面:

Page 438, line 17 from the bottom.
p2 = *a1[2]; 
should be  p2 = &a1[2];
Run Code Online (Sandbox Code Playgroud)