+ 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.
5 Respostas
+ 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.
+ 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.
+ 1
I just ran into the same issue with a C program in code playground.
Why is strrev() considered non-standard?
0
Why this compiler don't support string inbuilt function that is "strrev()" What's the reason behind this !
0
Meenu Saini , strrev is not supported by the compiler anymore. That is the reason