Hisworld.tistory.com
The hisWorld
(140)
hisworld_new
(0)
hisOld
(138)
Android
(7)
Computer Vision
(18)
JAVA
(4)
C/C++
(26)
열혈강의 C
(32)
TCP/IP socket
(12)
WinAPI
(16)
System Programming
(0)
etc
(23)
Plan
(0)
hisWorld
(0)
hiStory
(0)
hiStudy
(0)
hiSnap
(0)
홈
태그
미디어로그
위치로그
방명록
Windows Live Messenger
winapi
Join C
대학생 공모전
The Turing test page
훈스닷넷
C/C++ Reference
WIKI
/
/
블로그 내 검색
열혈강의 C 도전 프로그래밍 FOUR - 5
URUZ-7
2008. 4. 27. 08:17
2008. 4. 27. 08:17
#include
#include
#include
int main(int argc, char *argv[]) { char ch1,ch2; FILE *fp1,*fp2; if(argc >3 || argc < 3) { printf("잘못된 사용법 입니다.\n"); exit(1); } if( (fp1=fopen(argv[1],"rt")) == NULL) { fprintf(stderr,"File %s Open Error!!\n",argv[1]); exit(1); } if( (fp2=fopen(argv[2],"rt")) == NULL) { fprintf(stderr,"File %s Open Error!!\n",argv[2]); exit(1); } while(ch1 != EOF || ch2 != EOF) { ch1 = fgetc(fp1); ch2 = fgetc(fp2); if(ch1 != ch2) { printf("%s와 %s 같은 파일이 아닙니다.\n",argv[1],argv[2]); exit(1); } else continue; } printf("%s와 %s 같은 파일입니다.\n",argv[1],argv[2]); fclose(fp1); fclose(fp2); return 0; }
invalid-file
공유하기
게시글 관리
구독하기
Hisworld.tistory.com
+ Recent posts
Powered by
Tistory
, Designed by
wallel
Rss Feed
and
Twitter
,
Facebook
,
Youtube
,
Google+
티스토리툴바