Selamat Datang Di Blogg Saya

Senin, 15 November 2010

Fungsi string strtok

list prigram


#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