#include <stdio.h>
#include <stdlib.h>
void main (int argc, char* argv [])
{
int f1, f2 = 1;
char *name;
FILE *p1,*p2;
if((p1 = fopen(argv[1], "r") == NULL ){
printf (" %s not found!! Are you joke?!! \n ", argv[1]);
exit(1);
}
if(argc != 3 && argc != 2){
printf(" breeeaaak!! \n");
exit(1);
}
if(argc == 3){
if(( p2 = fopen(argv[2],"r") ) != NULL){
printf("Input the file name again \n",argv[2]);
printf("Copy file name: ");
gets(argv[2]);
}
p2 = fopen(argv[2],"w");
while( (f1 = getc(p1) ) != EOF)
putc(f1, p2);
printf("Success");
fclose(p2);
}
else if(argc == 2){
name = argv[1];
while((p2 = fopen("name(cnt).txt","r")) != NULL){
f2++;
}
p2 = fopen("name(cnt).txt","w");
while( (f1 = getc(p1) ) != EOF)
putc(f1, p2);
fclose(p2);
}
else
printf("error\n");
fclose(p1);
}
컴파일도 안해보고 올린다 ㅋㅋㅋ
'MySelf' 카테고리의 다른 글
mp3업로드 불가능 ㅅㅂ (0) | 2007.04.16 |
---|---|
시험공부... (0) | 2007.04.16 |
Malice Mizer - ILLUMINATI... (0) | 2007.04.15 |
CP명령어를 만들어 봅시다~ (0) | 2007.04.15 |
텍스트 컴포넌트 (1) | 2007.04.15 |
테터 초기화?! (0) | 2007.04.15 |