I am using c++ stdio.h’s
int rename ( const char * oldname, const char * newname );
rename() function to rename a folder but occasionally it fails to rename the folder and returns -1.
Is there any way to know why is rename() failing?
any way to know this error explanation via any c++ function.
It should be possible to get the concrete error from errno.h
The
errnoerror codes forrenameare OS-specific:_errnoinstead oferrno)