void doit(char sentence[255], char temp, int lettercount, int lettercount2) {
for(int i=0; i < lettercount2; i++){
temp == sentence[i];
sentence[i] == sentence[lettercount];
sentence[lettercount] == temp;
lettercount--;
Should be:
1 2 3 4 5 6
void doit(char sentence[255], char temp, int lettercount, int lettercount2) {
for(int i=0; i < lettercount2; i++){
temp = sentence[i];
sentence[i] = sentence[lettercount];
sentence[lettercount] = temp;
lettercount--;
The double equal sign tests whether both the left and right values are equal, and returns true if they do. In this case, you wanted to use the assignment operator, which assigns the value to the right of the operator to the variable to the left.
Hey thanks for the tip; but what it's doing now is assigning nothing to "sentence" whereas before it would just cout the same sentence without changing anything.