char *p = strtok(buffer, " ,"); // ',', space while (p) { if ((*p >= 'A' && *p <= 'Z') || (*p >= 'a' && *p <= 'z')) { // A-Z, a-z cout << p << endl; // do your job } else if (*p >= '0' && *p <= '9') { strstream ss(p, strlen(p)); ss >> num; cout << num << endl; } p = strtok(0, " ,"); } } fclose (f); } system("pause"); }
This entry passed through the Full-Text RSS service — if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers. Five Filters recommends:
留言列表