rip-off that link you gave me says that an array and pointer is the same thing! Now im really confused!
int foo(int A[], int n) { return A[n];}int bar(int * A, int n) { return A[n];}
Here's the assembly MSVC 2003 generates for foo:
mov eax, DWORD PTR _n$[esp-4]
mov ecx, DWORD PTR _A$[esp-4]
mov eax, DWORD PTR [ecx+eax*4]
ret 0
Here's bar:
mov eax, DWORD PTR _n$[esp-4]
mov ecx, DWORD PTR _A$[esp-4]
mov eax, DWORD PTR [ecx+eax*4]
ret 0
I know I can use string to declare it, but when applying for jobs they want me to write it in the conventional "C" style code to show them i know the "inner" workings of how code is executed down to the assembly code level.