Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <ctype.h>
- typedef struct node_ {
- char* val;
- struct node_ * next;
- } node;
- int main(int argc, char** argv) {
- if (argc != 2) {
- printf("ERROR: This program takes exactly one argument.\n");
- return 1;
- }
- char buffer[50] = "\0";
- int i;
- for (i = 0; i < strlen(argv[1]) - 1; i++) {
- char c = argv[1][i];
- if (isalpha(c)) {
- buffer[strlen(buffer)] = c; // Add character to buffer
- } else {
- printf("%s\n", buffer); // Print buffer
- buffer = "\0"; // Clear buffer
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement