You are passing a constant string to your function.
String literals are of type char [N + 1]
(where N
is the length of the array) in C, but modifying them results in undefined behavior. Your compiler should have already issued a warning at that point.
If you wish to modify it then you have to create a copy:
char str[] = "BeforeSunrise";
char* rev2=reverseInPlace(str);