数组可以作为const指针调用吗?

kid*_*ddo 1 c arrays pointers

这是非常基本的...但如果有人知道这个请帮助我......数组可以被称为const指针吗?

Vla*_*lad 5

你的意思是"可以在需要const指针的地方使用数组"吗?在那种情况下,是的:

void f(const int* p)
{
    ...
}

int ar[10];
f(ar); // this works, array is essentially a pointer
Run Code Online (Sandbox Code Playgroud)