0
파일 열기 및 쓰기 파일 방법을 사용하여 이미지 파일을 복사하려했지만 이미지를 얻으려고했습니다 ... 그래서 코드와 함께 도와주세요. 헤더 파일이 필요합니다.C 언어로 이미지를 디렉토리에 복사하는 방법
char ch, source_file[20], target_file[20];
FILE *source, *target;
source = fopen("Source", "r");
if(source == NULL)
{
printf("Press any key to exit...\n");
}
target = fopen("Destination", "w");
if(target == NULL)
{
fclose(source);
}
while((ch = fgetc(source)) != EOF)
fputc(ch, target);
printf("File copied successfully.\n");
fclose(source);
fclose(target);
나는이 시도 ....
그래서 귀하의 질문은 무엇입니까
발터? –
코드를 시작한 다음 살펴보아야합니다. – smushi
당신은''이 필요합니다. 당신은'fread()'와'fwrite()'를 사용할 수 있습니다; 당신은'fopen()'을 사용할 것이다; 당신은 아마도 공개 호출에서 플래그 중 하나로서'b'를 사용할 것입니다. –