I have written the code to reverse a string. I think the logic is correct. I can compile it, but I am unable to run it. I am trying to use MinGW on windows. Can someone point out what the problem might be?
void reverse(char * start, char * end){
char ch;
while(start != end){
ch = *start;
*start++ = *end;
*end-- = ch;
}
}
int main(){
char *c = (char *)"Career";
int length = strlen(c);
reverse(c,c+length-1);
}
Thanks