5. Write c++ function that would intake a string and return
the number of occurrences of a given character in that sring
Ex:- if the word is “Colombo” and count the occurrences of
the letter “o” the function would return 3
Answer / qliubrvq
occurrences(string str, char test) {
int len = str.size();
int count = 0;
for (int i = 0; i < len; i++) {
if (str[i] == test) count++;
}
return count;
}
| Is This Answer Correct ? | 0 Yes | 0 No |
How Find, Replace and Go To commands ca be used to substitute one character string for another? Explain with the heIp of an example.
what is compiler?
how to use C++?
What is a standard template library (stl)? What are the various types of stl containers?
write a c++ to define a class box with length,breadth and height as data member and input value(),printvalue() and volume() as member functions.
Define the terms: field, record, table and database
What is the Difference between CArray and CList?
1 Answers ProdEx Technologies, Siemens,
Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.
write a program that input four digit number and find how many 7 that number contains
differentiate between private, public and protected data members of the class using example.
give me the defination of inheritance?
What is Constructor