|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
- #include <stdio.h>
- #include <stdlib.h>
- typedef FILE *pFILE;
- static
- void Usage ( void ) {
- fprintf(stderr, "Usage: Image/Picture, Any/File, OutFileName.\n");
- exit(0);
- }
- int main ( int argc,char *argv [] )
- {
- pFILE fargImage = NULL,
- fargFile = NULL,
- fargOutFile = NULL;
- char wCharacter;
- /*
- * If it is the first one, argv [0] should be the name of the program
- * itself, indicating that there is no other file name
- */
- if (argc == 1) {
- Usage();
- } if ( !( fargImage = fopen(argv[1], "rb") ) ) {
- printf("Not Found Image File!\n");
- Usage();
- } if ( !( fargFile = fopen(argv[2], "rb") ) ) {
- printf("Not Found File!\n");
- Usage();
- } if ( !( fargOutFile = fopen(argv[3], "wb") ) ) {
- printf("Not Found Out File!\n");
- Usage();[font=Times New Roman][/font]
- }
- while ( !( feof(fargImage) ) )
- {
- wCharacter = fgetc(fargImage);
- fputc(wCharacter, fargOutFile);
- }
- fclose(fargImage);
- while ( ! (feof(fargFile) ) )
- {
- wCharacter = fgetc(fargFile);
- fputc(wCharacter, fargOutFile);
- }
- fclose(fargFile);
- fclose(fargOutFile);
- return 0;
- }
复制代码 |
|