Learning C Programming Lesson 25: Pointers and Arrays
Loading...
12,608
Loading...
Top Comments
see all
All Comments (8)
-
@Joeyinsane69 ... we reserve one extra for null character when we are using strings.... in this case we are using array of numbers which does not require a null character.....
-
shouldnt it be int intArr [11] = {1,2,3,4,5,6,7,8,9,10}?
one extra for the Null character
-
Why do you have a comment here:
int *ptr=intArr; // shorthand for intArr[0]
That comment is misleading and incorrect. intArr == &intArr[0]. intArr[0] may not (and in this case MOST LIKELY WON'T be equal to intArr. intArr decays to a pointer to integer. The type of intArr[0] is int. The two types are incompatible by the standard.
-
shouldn't that be *ptr = &intArr[0] @ 1:00 since u need the start adress of intArr and not its 1st value
-
Thanks.
Loading...
size too small...btw thanks for ur gr8 effort
18watchmen 2 years ago 3
No indentation? hmmm =/
0121ryanh117 2 years ago