+ 5

Strrev function not working in code playground.

I coded these a few months ago. https://code.sololearn.com/croGlRYV4vLu/?ref=app https://code.sololearn.com/cn7QDS2e0SzH/?ref=app These codes didnt have any problem running the day i coded these. But now the strrev function is not recognised. Please help. Does anyone know any alternatives to this function? Thanks in advance.

15th Dec 2019, 5:54 PM
Salman Nazeer
Salman Nazeer - avatar
5 Antworten
+ 9
A nice example of how using non-standard functions can one day backfire. C++ libraries are not required to have support for these non-standard functions. Sololearn recently updated their C++ compiler and switched from windows to linux, so that probably explains why it suddenly doesn't compile anymore. As for how to reverse, you can use this: https://en.cppreference.com/w/cpp/algorithm/reverse Or you could write your own reverse function, it's only a few lines of code.
15th Dec 2019, 7:24 PM
Dennis
Dennis - avatar
+ 2
I don't know why they didn't make the function standard. Perhaps because the use case for reversing strings is very limited in the real world so they didn't bother? I've certainly never had a use for it. Who knows.
8th May 2020, 11:41 AM
Dennis
Dennis - avatar
+ 1
I just ran into the same issue with a C program in code playground. Why is strrev() considered non-standard?
8th May 2020, 9:34 AM
Ian Andersen
Ian Andersen - avatar
0
Why this compiler don't support string inbuilt function that is "strrev()" What's the reason behind this !
1st Jun 2020, 8:47 AM
‏‪Meenu Saini‬‏
0
Meenu Saini , strrev is not supported by the compiler anymore. That is the reason
7th Jun 2020, 10:33 AM
Salman Nazeer
Salman Nazeer - avatar