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 |
Describe how to safeguard a system through acquisition of an antivirus Program and systematic backup.
What is stl language?
What is the stl, standard template library?
WHAT IS THE DIFFERENCE BETWEEN C++ AND VC++
What do stl stand for?
Who wrote stl?
what is a template?
2 Answers Amazon, BITS, IBS, Wipro,
how to swap two numbers in a linked list without exchanging the data but only the links?
what's the difference between abstract class and concreate class? what's the meaning of standard template library(STL)?
wap in c++ which accept a integer array and its size as argument and replaces element having even values with its half and element having odd values with twice its value
What is Object Oriental Progam
totoo po ba ang manga aliens!