#include <iostream>
using namespace std;
int main()
{
char a[10] = "He is ";
char b[10] ="good boy.";
cout << strtok(a," ") << endl;
return 0;
}
#include <iostream>
using namespace std;
int main()
{
char a[] = "He is good boy.";
cout << strtok(a," ") << endl;
cout << strtok(a," ") << endl;
return 0;
}
#include <iostream>
using namespace std;
int main()
{
char a[] = "He is good boy.";
cout << strtok(a," ") << endl;
cout << strtok(NULL," ") << endl;
return 0;
}
#include <iostream>
using namespace std;
int main()
{
char a[] = "He is good boy.";
char *p = a;
p = strtok(a," ");//Starting Tokenization.
while ( p != NULL)
{
cout << p << endl;
p = strtok(NULL," "); //Appends \0 after each tokenization.
}
return 0;
}
#include <iostream>
using namespace std;
int main()
{
char a[] = "He,is, good, boy.";
char *p = a;
p = strtok(a,",");//Starting Tokenization.
while ( p != NULL)
{
cout << p << endl;
p = strtok(NULL,","); //Appends \0 after each tokenization.
}
return 0;
}
No comments:
Post a Comment