Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <ctype.h>
- #include <math.h>
- int main(int argc, char * argv[]) {
- FILE * in = fopen(argv[1], "r");
- FILE * out = fopen(argv[2], "w");
- if(in == NULL || out == NULL) {
- printf("Ne postoi datotekata\n");
- return 0;
- }
- char niza[2000];
- int j = 0;
- char c;
- while((c = fgetc(in)) != EOF) {
- if(c == '\n') {
- for(int i = 0; i < j; i++) {
- printf("%c", niza[i]);
- }
- printf("\n");
- j = 0;
- }
- else {
- niza[j] = c;
- j++;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment