优化了命名

This commit is contained in:
lzy
2024-04-28 13:10:56 +08:00
parent d75a518c0f
commit ba9f2e37a7
155 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
#include <stdio.h>
#include <stdlib.h>
/**
* @brief
* @details
* usage: ./mycpy <src> <dst>
*
* @return int
*/
int main(int argc, char **argv)
{
FILE *fps, *fpd;
int ch;
if (argc < 3)
{
fprintf(stderr, "Usage:%s <src> <dst>\n", argv[0]);
exit(1);
}
fopen(argv[1], "r");
if (NULL == fps)
{
perror("fopen()");
exit(1);
}
fopen(argv[2], "w");
if (NULL == fpd)
{
// !!!
fclose(fps);
perror("fopen()");
exit(1);
}
while (1)
{
ch = fgetc(fps);
if (EOF == ch)
break;
fputc(ch, fpd);
}
fclose(fpd);
fclose(fps);
exit(0);
}