C++ Wcstok() Function

#include<iostream>
#include<cwchar>
using namespace std;
int main()
{
    wchar_t str[50];
    wchar_t d[2];
    wchar_t *t;

    cout << "Enter A String : ";
    wcin >> str;
    cout << endl;

    cout << "Enter A Character : ";
    wcin >> d;
    cout << endl;

    t = wcstok(str, d);

    while(t != NULL)
    {
        wcout << t << endl;

        t = wcstok(NULL, d);
    }

    return 0;
}

Comments