Below is an exceedingly simple example. It compiles fine using gcc on Mac OS X (Snow Leopard). At runtime it outputs Bus error: 10. What\'s happening here?
You are trying to modify a string constant. Use this instead:
char a[] = "abc"; a[0] = 'c';