 <p>This is how the function should be:</p> <pre><code>void swap(chat *a, char *b) { char tmp = *b; *b = *a; *a = tmp; } </code></pre> <p>You don't need to pass 5 arguments to it; only 2, which are the two characters you want to swap.</p> <p>And don't dereference the <code>tmp</code> variable, since it is not a pointer.</p>