help with strings
Hi everybody,,please help,,i have array of char,i have to split it into tokens with strtok and set alphabetically,,,,please help
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
#include<iostream>
using namespace std;
int main()
{
const int n=100;
char a[n], *t;
cin.getline(a,n,'.');
t=strtok(a,",");
while(t)
{
cout<<t<<endl;
t=strtok(NULL,",");
}
return 0;
}
|
i've done strtok i just can't sort alphabetically
Topic archived. No new replies allowed.