I'm a newbie and I've been reading C++ All in one for dummies 2nd Edition and the 'Hello World' program works fine, but when I type this (directly copied from the book), I get the error below. I've tried the code in Geany and CodeBlocks:
user@user-G73Sw:~/projects/GeanyProject$ /bin/sh ./geany_run_script.sh
main.cpp:9:5: error: stray ‘\342’ in program
main.cpp:9:5: error: stray ‘\200’ in program
main.cpp:9:5: error: stray ‘\234’ in program
main.cpp:9:5: error: stray ‘\342’ in program
main.cpp:9:5: error: stray ‘\200’ in program
main.cpp:9:5: error: stray ‘\235’ in program
main.cpp: In function ‘int main()’:
main.cpp:9:19: error: ‘Hello’ was not declared in this scope
main.cpp:9:25: error: expected ‘;’ before ‘there’
Thank you Mohammed for the quick response. That worked beautifully.
I found out what the problem was: I have the .pdf book and it seems to use the incorrect quotes that look like this: ”text”, as opposed the the quotes that work that should be like this: "text" ... so when I copied the text over from the .pdf book to my IDE it wouldn't run until I fixed the quotes.
Btw, I heard on Amazon from a reviewer that this book was written in 2003 and is outdated. Does anyone know if that is true?