+ 3

Strrev function

Can't we use strrev() in here?? #include <stdio.h> #include <string.h> int main() { char h[20]; scanf("%s",h); int len=strlen(h); char k[20]; k=strrev(h); printf("%s",k); return 0; } It says that fuction strrev is not defined.

29th Jan 2020, 2:28 AM
전은지
전은지 - avatar
3 Respostas
+ 12
According to this thread, strrev may not be available in certain compilers. https://www.sololearn.com/Discuss/1350351/?ref=app
29th Jan 2020, 2:37 AM
Hatsy Rei
Hatsy Rei - avatar
+ 1
May be because of sololearn I too used it many times it occur same You could use loop to reverse the string Or try this in another app Like turbocdriod
29th Jan 2020, 2:39 AM
Samarendra Singh
Samarendra Singh - avatar
+ 1
strrev used to work in sololearn because they used microsoft servers, but these days they switched to linux servers. and the strrev function does not work on linux due to different platform and compiler. you can build the function yourself if you want to use the strrev function
30th Jan 2020, 8:10 PM
Shen Bapiro
Shen Bapiro - avatar