Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <ctype.h>
- int main(int argc, char * argv[]) {
- if(argc < 3) { // brojot na argumenti e pomal od 3, sto znaci deka ne sme vnele dovolno za da imame ime na vlezna i izlezna datoteka
- printf("Vnesete gi iminjata na datotekite preku komadna linija\n");
- return 0;
- }
- FILE * in = fopen(argv[1], "r");
- FILE * out = fopen(argv[2], "w");
- if(in == NULL) {
- printf("Ne vnesovte validen fajl za citanje\n");
- return 0;
- }
- if(out == NULL) {
- printf("Ne vnesovte validen fajl za pecatenje\n");
- return 0;
- }
- int x;
- fscanf(in, "%d", &x);
- fprintf(out, "%d\n", x);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement