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(int argc, char * argv[]) {
- if(argc < 3) {
- printf("Nema dovolno argumenti\n");
- return 0;
- }
- FILE * in = fopen(argv[1], "r");
- FILE * out = fopen(argv[2], "w");
- if(in == NULL || out == NULL) {
- printf("Ne postojat datotekite\n");
- return 0;
- }
- char niza[2000];
- int i = 0;
- char c;
- while((c = fgetc(in)) != EOF) {
- niza[i] = c;
- if(niza[i] == '.') {
- printf("%s\n", niza);
- i = 0;
- niza[0] = '\0';
- }
- else {
- i++;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment