DEV Community

Discussion on: Pointers arithmetic

Collapse
 
marciocg profile image
Márcio Conceịç̣̣ão Goulart

Hi there,

i got an error when compiling:
arraysum.c: In function ‘arraySum’:
arraysum.c:7:46: error: ‘n’ undeclared (first use in this function)
const myArrayEnd = myArray + n;
^
changing 'n' to 'num' worked. Also, where you wrote "10th element of the array..." You're talking about the 12th element, I guess.

These posts about C are great, thanks for sharing!

Collapse
 
mikkel250 profile image
mikkel250

Good catch, thanks! I changed the post so these are correct.