我有一个像这样的二维数组:
void getC(int **p)
{
   *p = &c[0][0];
}
int c[10][10];
int *a;
getC(a);
a[0][0];
it says error: no match for 'operator[]' in `a[0][0];` what is the problem and how to fix it?
您正在使用C++编译器编译C程序.小心!
您需要c在getC函数上面定义(或提供前向声明).
你有一个函数以外的语句,这在C中是不允许的.用它包装int *a和后续行int main(void) { ... }
你需要一个&让你的getC()电话合法 - 你正在通过int *,但它期望int **:
getC(&a);
声明a[0][0]没有效果,无论如何都是错的,因为a它只是一个int *; 你不能两次取消引用它.
您可能应该获得一本初学者C书并开始学习它.