Question: ***in c*** Implement a function void *rotate string in place(char *str, unsigned int disp) that accepts a string and a displacement and rotates each alphabetical
***in c***
Implement a function void *rotate string in place(char *str, unsigned int disp) that accepts a string and a displacement and rotates each alphabetical character in the string by the given displacement to the right where 0 disp 2600. Non alphabetical characters are retained without modification. Right shifting a character beyond Z by 1 rotates around to A (similarly z rotates around to a). The input string is modified by the function.
Sample input and output:
str: "Hello World, displacement: 5, str after calling rotate string in place: Mjqqt Btwqi
str: ", displacement: 100, str after calling rotate string in place:
str: "Hey You!, displacement: 11, str after calling rotate string in place: Spj Jzf!
str: gcc -c hw.c -o hw, displacement: 2413, str after calling rotate string in place: bxx -x cr.x -j cr
str: "Hello", displacement: 0, str after calling rotate string in place: "Hello"
str: "Hello", displacement: 26, str after calling rotate string in place: Hello"
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
