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>
- int main(void){
- size_t n;
- int i;
- char *p, *a[512], *str, *b[512], *res;
- FILE *fp=fopen("set.txt","r");
- getline(&str, &n, fp);
- if (n > 512) {
- printf("Size fault\n");
- return -1;
- }
- p = strtok(str, " ");
- a[0]=p;
- printf("%s\n",a[0]);
- i=1;
- while(p != NULL)
- {
- p=strtok(NULL, " ");
- a[i]=p;
- printf("%s\n", a[i]);
- i++;
- }
- //for ()
- fclose(fp);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement