I wrote this function to reverse a string in C, but when switching characters in the string the program crashes. I have no idea what\'s causing it, so any help would be apprecia
"Example" is a string literal, which usually means you cannot change it.
"Example"
Please try this:
char str[] = "Example"; reverse(str);