There is a character array whose contents are: "Student a am i", please change the contents of the array to "i am a student".//Requirements://cannot use library functions. Only a limited space can be opened (the number of spaces is independent of the length of the string). #include <stdio.h> #include <string.h>void fanw (Char *left, char *right) //to flip each word { char* pleft = left; char* pright = right; char temp; while (pleft < pright) { temp = * pleft; *pleft = *pright; *pright = temp; pleft++; pright--; }}void fans (char *p) //Flip the word back { while (*p != ') { char *pst = p; while (*p != ' && *p != ' ') { p++; } fanw (pst, p - 1); &nbSp;p++; }}int main () { char p[30] = "Student a am i"; int len = strlen (P); printf ("Original string is : %s\n", p); printf ("Flipped string is :") ; fanw (p, p + len - 1); fans (P); printf ("%s\n", p); return 0;}
Reverse order of character array contents