void swapletter(char word[])
{
char temp1;
int swap1;
int swap2;
cout<<"What is the first location: ";
cin>>swap1;
cout<<"What is the second location: ";
cin>>swap2;
temp1 = word[10];
word[swap1] = word[swap2];
word[swap2] = temp1;
cout<<"The result is: "<<temp1;
};
You are trying to swap elements of the array? The idea you have for swapping is correct, but as writetonsharma pointed out, you should be doing: temp1 = word[swap1]; // possibly swap1-1
> It doesn't print out the result at the end.
Line 17 is confusing. What result are you trying to achieve?