I would like to know how do u get to the end of the string, copy the remainding characters then pasting it to the front of the string without overwriting it. Thanks =)
I would like to know how do u get to the end of the string, copy the remainding characters then pasting it to the front of the string without overwriting it. Thanks =)
IF u are already at the end of a string, what are the remaining characters?
One way is to move all the characters down along the array. ALternatively, a more complicated and better way ( not if u're making something simple ) is to use linked lists.
The remaining characters I was talking about was in the middle of the string ...... =)
eg.
Input = hello
value = 4
output = elloh
This is y I want to know how 2 get to the end of the string and bring it to the front.
Can the code help you?
Code:tmp = str[0]; for(i = 0;i < strlen(str) - 1;i++) str[i] = str[i + 1]; str[strlen(str) - 1] = tmp; str[strlen(str)] = '\0';