I have a program where I'm supposed to have someone input a word and I have the program leave the first and last letters stay while everything else becomes randomized.
I pretty much have the program working, but I don't know how to ignore the first letter.
This is all I have:
char word[256];
void scramble()
{
for(int i = 1; i < strlen(word)-1; i++)
{
int x = rand() % (strlen(word)-1);
int y = (rand() * 10) % (strlen(word)-1);
if(x == y)
{ i--; continue; }
char temp = word[x];
word[x] = word[y];
word[y] = temp;
}
Any help is appreciated!