Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<string.h>
- #include <stdlib.h>
- #define ARRAY_MAX 100
- int main() {
- FILE *input, *output;
- char *token[100];
- char buf[100];
- int count = 0;
- input = fopen("/Users/home/Desktop/test.txt", "r");
- output = fopen("/Users/home/Desktop/test2.txt", "w");
- while (fgets(buf, sizeof(buf), input) != NULL) {
- token[count] = strtok(buf, "n");
- ++count;
- }
- for (int i = 0; i<count; i++) {
- printf("%sn", token[i]);
- }
- printf("%dnn" ,count);
- return 0 ;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement