Keep getting BAD_ACCESS when compiling C in Xcode <p>If I start a new Command Line C Project in Xcode and enter the following code I always get a EXC_BAD_ACCESS error when compiling the project.</p> <pre><code>int main(int argc, const char * argv[]) { char *foo = "Hello"; *foo = 'M'; // get EXC_BAD_ACCESS here when compiling } </code></pre> <p>I'm just learning C and can't workout what is wrong with this statement? I'm just trying to change the character at a certain memory location. Has anyone got any ideas?</p>