All pastes #29363 Raw Edit

Stuff

public text v1 · immutable
#29363 ·published 2005-11-19 22:00 UTC
rendered paste body
char *reverse(char *str) {
    char *buf = (char *)malloc(strlen(str) + 1), tmp[] = " ";
    
    for(int i=strlen(str)-1;i>=0;i--) {
        tmp[0] = str[i];
        strcat(buf, tmp);
    }
    
    return buf;
}