0
Why I am unable to use "strrev" for reverse of a string.
#include<stdio.h> #include<string.h> #include<conio.h> int main() { int name[20]; printf("Enter your name:"); gets(&name[0]); strrev(name); puts(name); } It is not compiled. Please help
6 Respostas
+ 5
you can try this👇
#include <stdio.h>
#include <string.h>
int main() {
char word[30];
scanf ("%s", word);
for ( int i = strlen ( word) - 1; i >= 0; i--){
printf ("%c", word[i]);
}
return 0;
}
+ 6
strrev is non standard and deprecated function. So dont work on modern compilers.. Here also strrev won't work.
+ 5
Wlcm bro.
Happy coding....
+ 1
Alphin K Sajan thank you very much
- 1
Alphin K Sajan so, what should I do???