Programming principles and practice (2nd) by Bjarne stroustrup - Chapter 3.3 , code isn't working <p>So i just started reading this book and copy pasted from the pdf file this code :</p> <pre><code>// read name and age (2nd version) int main() { cout &lt;&lt; "Please enter your first name and age\n"; string first_name = "???"; // string variable // ("???” means “don’t know the name”) int age = –1; // integer variable (–1 means “don’t know the age”) cin &gt;&gt; first_name &gt;&gt; age; // read a string followed by an integer cout &lt;&lt; "Hello, " &lt;&lt; first_name &lt;&lt; " (age " &lt;&lt; age &lt;&lt; ")\n"; } </code></pre> <p>The book says it should output</p> <pre><code>Hello, 22 (age –1) </code></pre> <p>if i input</p> <pre><code>22 Carlos </code></pre> <p>but i get this error</p> <pre><code>D:\C++\Part I The Basics\Programs\3.Read name and age (2nd).cpp|9|error: stray '\226' in program| </code></pre> <p>And the program isn't compiling.</p> <p>I realized that in the line below the "minus 1" isn't actually a "minus" "-" sign. .. " – " " - " It is bigger than the minus, see?</p> <pre><code>int age = –1 </code></pre> <p>So i changed that sign with a minus sign and typed 22 Carlos and it outputs Hello 22, 0 instead of Hello 22, -1.</p> <p>My questions are: </p> <p>Why is the program not working when i simply copy paste it from the pdf?</p> <p>Why it's not working even after i change the – sign with a minus "-" sign?</p>