Hi I want to create a program where I will input different names and I will output it in UPPERCASE FORM. However there's a bug in my code, can you help me to figure it out?
It said "[Error] no match for 'operator>=' (operand types are 'std::string {aka std::basic_string}' and 'int')"
int times;
string name [1000];
int i = 1;
int hold = 0;
int j ;
int cont;
while( i != 0){
cout<<"Enter Name "<<endl;
cin>>name[hold];
times = hold;
for ( j = 0 ; j <= strlen(name) ; j++){
if (name[j] >= 97 && name[j] <= 122){
name[j] = name[j] -32;
}
}
cout<<"\n[1] for Add"<<endl;
cout<<"[2] for Stop"<<endl;
cin>>cont;
if ( cont == 1){
hold++;
i = 1;
}else{
i = 0;
}
}
for ( i = 0 ; i <= times ; i++){
cout<<name[i]<<"\n";
}