Possible Duplicate:
C: differences between pointer and array
Is an array
in C++
a pointer
? Can you clarify this?
Thanks.
Possible Duplicate:
C: differences between pointer and array
Is an array
in C++
a pointer
? Can you clarify this?
Thanks.
No. But it can decay to a pointer whenever you need it.
void foo1(char * c) {
}
int main() {
char Foo[32];
foo1(Foo); // Foo decays to a pointer
char * s = Foo; // Foo decays to a pointer which is assigned to s
}
The array name itself without any index is a pointer.
int a[10];
printf("%d\n",*a); // will print first value
printf("%d\n",*(a+1) ); // will print second value