output should like that:
input #: (909)869-2511
area code: (909)
exchange: 869
ext.: 2511
telephone #: (909)869-2511
this is my code so far:
#include "stdafx.h"
#include <iostream>
#include <iomanip>
#include <cstring>
using std::strtok;
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
char sentence[32];
char *tokenPtr;
tokenPtr = &sentence;
cout << "Input Telephone No.: " ;
cin >> sentence;
tokenPtr = strtok( sentence, " " );
while ( tokenPtr != NULL )
{
cout << tokenPtr << '\n';
tokenPtr = strtok( NULL, " " );
}
return 0;
}