 <p><strong>C++</strong></p> <p>This would work in C++ because the function signature for <code>get()</code> is probably this:</p> <pre><code>void get(char&amp; a); // pass-by-reference </code></pre> <p>The <code>&amp;</code> symbol after <code>char</code> denotes to the compiler than when you pass in a <code>char</code> value, it should pass in a <em>reference</em> to the <code>char</code> rather than making a copy of it.</p> <p>What this essentially means is that any changes made within <code>get()</code> will be reflected in the value of <code>a</code> outside the method.</p> <p>If the function signature for <code>get()</code> was this:</p> <pre><code>void get(char a); // pass-by-value </code></pre> <p>then <code>a</code> would be passed by <em>value</em>, which means a copy of <code>a</code> is made before being passed into the method as a parameter. Any changes to <code>a</code> would then only be local the method, and lost when the method returns.</p> <p><strong>C</strong></p> <p>The reason why this wouldn't work in C is because C only has <em>pass-by-value</em>. The only way to emulate <em>pass-by-reference</em> behaviour in C is to pass its pointer by value, and then de-reference the pointer value (thus accessing the same memory location) when modifying the value within the method:</p> <pre><code>void get(char* a) { *a = 'g'; } int main(int argc, char* argv[]) { char a = 'f'; get(&amp;a); printf("%c\n", a); return 0; } </code></pre> <p>Running this program will output:</p> <pre><code>g </code></pre>