I have written the following code. I have to count repetitions of the substring in the string. What will be the code to count repetitions of the substring?
You've defined count as an int. And no, you can't use an int as a function.
int count = std::count(str.begin(), str.end(), sbstr);, although that will also not work since the expected type of the third argument is char (and would require inclusion of the header <algorithm>.)