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!
I've been tinkering with computers since I was a teen. I'm currently pivoting from my current role as Tech Support manager to Full Stack Web Developer. I'm actively seeking employment in the field.
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!
Good catch, thanks! I changed the post so these are correct.