how to make a my program to finish repeated the loop when the user enter the sentinel value?? for example the "-1"...
this is my attempt..but still something wrong here..
#include <iostream>
using namespace std;
int printreverse(char letter_box[],int i)
{
for (int x=i; x>=0; x--){
cout<<letter_box[x];
}
}
char letter_box[10];
char answer;
int main ()
{
const int SENTINEL=-1;
int i=0;
do {
cout<<"Enter any letter (maximum is 10) :";
cin>>letter_box[i];
i++;
}while ( !=SENTINEL); //how do i correct this????
printreverse(letter_box,i);
system("pause");
}
Thank You for helping...