#include<stdio.h>
void revstr(char *s){
if(*s){
revstr(s+1);
putchar(*s);
}
}
int main(){
char *s;
gets(s);
revstr(s);
return 0;
}
$ ./a.out
srij
Segmentation fault
MOD EDIT: When posting code...USE CODE TAGS!!!
This post has been edited by JackOfAllTrades: 03 January 2011 - 05:59 AM

New Topic/Question
Reply




MultiQuote






|