I am at a loss for why this is code is giving me a read acess violation. dereferencing pointer and subtracting another char should work in Theory : <p>I dunno why this doesn't work. the code has a problem with the *c in 
charToInt function but should be a legal statement in c. at least so I thought. I am excited to learn something new here.</p>

<pre><code>int charToint(char *c) {
    return *c - '0';  
}

int main(void) {
    char c = '3';
    printf("%d\n", charToint(c));
{
</code></pre>
