You are kidding, right?
temp = character[i];
character[i] = character[j];
character[j] = temp;
Save a copy of character[i] for later:
temp = character[i];
Copy the value in character[j] into character[i] - if you hadn't saved a copy first, you would now have no idea what value it was.
character[i] = character[j];
Copy the original contect of character[i] into character[j] so they are swapped.
character[j] = temp;
To be honest, if you can't work that out code that trivial on your own, I'd suggest that computers are not for you ...