خرید بک لینک

Vote count: 0

so i have this set of strings which are stored in an array i want to search the array so when the string is found it should say found and when its not found it should say invalid this is what i have so far

cout << "Enter a Name to Search" <<endl;
cin >>userInput;

for (int i=0; i<size; i++)
{
   if (first_name[i]==userInput)
    {
        cout <<"Found"<<endl;
    }else{
          cout << "InValid"<<endl;
            break;
         }  
}

so every time i run this i am always redirected to The else Statement is there anyway for me to fix this

asked 30 secs ago

برچسب: javascript search through array of strings,objective c search through array of strings, نویسنده: استخدام کار تاريخ: سه شنبه 19 مرداد 1395 ساعت: 11:25

صفحه بندی