hey guyss..!!
I'm having some difficulties working with strings (cstyle, object oriented strings).
as this is something new for me so I'm not exactly familiar with functions of strings aswell..
write now i have a question for which i was making a solution but the code is missing something please help me out.
Question statement.
"Write a program that reads a whole paragraph (you can do that with a little common sense) from the user. Now prompt the user enters a word to be searched. Your program should read the search word and search for all the occurrences of that word in the entered text. You need to print the total number of occurrences of this word in the entered text."
My code.
#include<iostream>
#include<conio.h>
#include<string>
using namespace std;
int main()
{
string my_str;
cout<<"Please enter your paragraph.."<<endl;
getline (cin, my_str);
cout<<endl<<endl;
cout<<"please enter a word to be searched..!!"<<endl;
char x;
cin>>x;
my_str.find("x");
cout<<endl;
cout<<"The total number of"<< x <<"is: "<<x;
getch();
return 0;
}