#include
#include
using namespace std;
int main() {
char s[1000];
cin.getline(s,1000);
char *ptr;
ptr=strtok(s," “);
while(ptr!=NULL)
{
cout<<ptr<<endl;
ptr=strtok(NULL,” ");
}
return 0;
}
#include
#include
using namespace std;
int main() {
char s[1000];
cin.getline(s,1000);
char *ptr;
ptr=strtok(s," “);
while(ptr!=NULL)
{
cout<<ptr<<endl;
ptr=strtok(NULL,” ");
}
return 0;
}
@sourabhsingh282 Please share the question statement.
Also save your code on ide.codingblocks.com and share its link.
@sourabhsingh282 Your string tokenizer is working perfectly and is tokenizing based on space.
Please share the problem statement.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.