Possible Duplicate:
What is the difference between char s[] and char *s in C?
Difference between char *str = “…” and char str[N] = “…”?
I am a beginner in C programming. I am confused over these things:
char ar[]="hello";
char ar2[], *ar3;
ar2=ar;
ar3=ar;
Also is the above legal in case of 2D arrays like:
int arr[2][2]={{1,2},{3,4}};
int arr1[2][2],**arr2,*arr3;
arr1[0]=arr[0];
arr1=arr;
arr2=arr;
arr3=arr;
The other confusion was that I have seen above valid in case of structure.
struct test{
int ar[2];
} t1, t2;
int main()
{
t1.ar[0]=0;
t1.ar[1]=1;
t2.ar=t1.ar;
}
Please bear with me, I am a beginner in C.