#include <cstdlib>
#include <iostream>
#include <string.h>
using namespace std;
int main(int argc, char *argv[])
{
char s[] = "sesungguhnya yang batil itu akan lenyap";
cout<<"s = ["<<s<<"]"<<endl;
cout<<"Tokenya adalah"<<endl;
char* p = strtok(s," ");
while(p){
cout<<"\t["<<p<<"]"<<endl;
p = strtok(NULL," ");
}
cout<<"sekarang s = ["<<s<<"]"<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}
output Program
0 comments:
Posting Komentar