Tagged Questions
2
votes
3answers
458 views
How do you read this line of code?
Forgive me for my poor English, me and my friend were doing school homework, suddenly he asked me to read this line of code ptr = &array[1][1][1] (ptr is a pointer to an integer).
He said
...
-2
votes
4answers
846 views
C simple arrays and pointers question
So here's the confusion, let's say I declare an array of characters
char name[3] = "Sam";
and then I declare another array but this time using pointers
char * name = "Sam";
What's the ...
5
votes
6answers
847 views
why are both index[array] and array[index] valid in C?
For example consider:
int index = 3;
int array[4] = {0, 1, 2, 3};
then both index[array] and array[index] are valid expressions, much like *(index + array) and *(array + index).
In C arrays why is ...