I'm trying to write a simply Hello, World! program, but when attempting to compile with GCC, I receive the following error:
helloworld.c:5:18: error: expected ‘)’ before ‘World’
printf(“Hello World”);
^
helloworld.c:5:18: error: stray ‘\342’ in program
helloworld.c:5:18: error: stray ‘\200’ in program
helloworld.c:5:18: error: stray ‘\235’ in program
Why is this?
Compiler: GCC 4.8.4 (2014-12-19). OS: Ubuntu 14.04 (Trusty Tahr).
printf(“Hello World”);
This should be written as -
printf("Hello World");
Straight quotes should be used. Try changing style .
The octal sequence 342 200 234 is the UTF-8 byte sequence for the typographic double quote.
To fix it, replace it with the regular double quote, i.e. " instead of “.
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