Here is my code
int main()
{
float avg, age[] = { 23.4, 55, 22.6, 3, 40.5, 18 };
avg = average(age); /* Only name of array is passed as argument. */
printf("Average age=%.2f", avg);
return 0;
}
Compilation error in int main():
error: stray '\342' in program
error: stray '\200' in program
error: stray '\213' in program
You have "crap characters" in your source file.
\342 \200 \213 is octal for 0xE2 0x80 0x8B which is a zero width space in UTF-8 (Unicode U+200B), something no C compiler can make sense of (and something you can't see, zero-width after all, when UTF-8 is displayed correctly).
-> Use a text or code editor (even Windows' Notepad should do, if not saving as UTF-8, but any other editor would be better) and/or an integrated development environment to write your code. Don't ever use word processors or the like, that might introduce unwanted characters.
Use the following website. It will show you bad characters and then remove them:
View non-printable Unicode characters
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With