C strrev() function

  • By using this predefined function we can make string as reverse.
  • Its is required one argument of type char* i.e. an address of a string.
  • When we are working with strrev(), from given address upto null entire content will make reverse.

Syntax:

char* strrev(char* str);

Example:

#include
#include
#include
int main()
{
char str[10]=”K2schools”;
clrscr();
puts(str);
strrev(str);
printf(“\n Reverse string %s”,str);
getch();
return 0;
}

Powered by k2schools