the easiest way to do it would be to read the text into a buffer, make a buffer of the same size and copy the text to it a character at a time. The other easy approach is to travers the string and when a space is hit move the next character to it. when two spaces have been hit, move the next character 2 spaces back.
"hello my name is joe"
m & y move back a single space
n a m & e move back 2
i & s move back 3
etc...
The last easy approach i can think of is by using a combination of strstr & strcat to modify the buffer.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.