subject

What does the following code do?

#include
#include
#include
using namespace std;

//Function Prototype Declaration

bool seqsearch(vectorlist, string str);
void main()
{
//variable declaration
vectorlist;
string s, ser_str;
bool found;
int i, n;

//inputting the number of strings
cout << "Enter number of strings: ";
cin >> n;

//inputting strings into vector "list"

for (i=0; i {
cin >> s;
list. push_back(s);
}
cout << "Enter string to be searched: ";
cin >> ser_str;

//function call
found=seqsearch(list, ser_str);
if(found)
cout << "String found in Vector " << endl;
else
cout << "String not found in Vector." << endl;
system("pause");
} // end main
//Function Definition

bool seqsearch(vectorlist, string str)
{
bool found=false;
int i;
for (i=0; i {
if(list[i]==str)
{ found=true;
break;
}
}
return found;
}

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 03:00, SKYBLUE1015
What are the different parts of computer
Answers: 2
image
Computers and Technology, 23.06.2019 05:00, sharkboy578
Acompany is inviting design for its new corporate logo from its users. this is an example of ? a. crowdfunding b. crowdvoting c. crowdsourced design d. crowdtracking
Answers: 3
image
Computers and Technology, 23.06.2019 11:30, magicalpenguin48
In cell h5 enter a formula that will calculate the percentage of attendees that went to the altamonte springs job fair in 2018.
Answers: 1
image
Computers and Technology, 23.06.2019 18:00, joybeth9591
What can a word user do with the customize ribbon dialog box? check all that apply. minimize the ribbon add a new tab to the ribbon remove a group from a tab add a group to a tab choose which styles appear choose which fonts appear choose tools to appear in a group
Answers: 1
You know the right answer?
What does the following code do?

#include
#include
#include
using nam...

Questions in other subjects:

Konu
Mathematics, 08.10.2019 22:50