Created
November 19, 2017 10:50
-
-
Save AungWinnHtut/54cc0c7fc68898129beb115fd3b3e3fb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<conio.h> | |
#include<stdlib.h> | |
#include<time.h> | |
void delay(unsigned int mseconds); | |
int main( int argc, char *argv[]) | |
{ | |
FILE *fin,*fo; | |
if(argc!=3) | |
{ | |
printf("error! correct arg no is 3 \n"); | |
getch(); | |
exit(1); | |
} | |
fin=fopen(argv[1],"r"); | |
fo=fopen(argv[2],"w"); | |
if(fin== (FILE *)0) | |
{ | |
printf("file error!\n"); | |
exit(1); | |
} | |
int byte; | |
int count=0; | |
int i=0; | |
do{ | |
byte=getc(fin); | |
if(byte!=EOF) | |
{ | |
fputc(byte,fo); | |
} | |
i++; | |
}while(byte!=EOF); | |
fclose(fo); | |
fclose(fin); | |
system("notepad e:\\path1.txt"); | |
return 0; | |
} | |
void delay(unsigned int mseconds) | |
{ | |
clock_t goal = mseconds + clock(); | |
while (goal > clock()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment