|
在开发板上有个程序,我要执行./ssss -o outfile infile 然后执行。现在我想直接./ssss 就可以执行,自动读取infile文件,然后输出到 outfile文件,不知道,如何修改,网上有说:- 比如:test a.c b.c t.c
- 则
- argc = 4
- argv[0] = "test"
- argv[1] = "a.c"
- argv[2] = "b.c"
- argv[3] = "t.c"
复制代码 但是我不知道那个 -o 算不算一个啊??
我的main()代码如下,请问具体如何修改啊,赐教下啊!- int main( int argc, char **argv )
- {
- x264_param_t param;
- cli_opt_t opt = {0};
- int ret = 0;
- FAIL_IF_ERROR( x264_threading_init(), "unable to initialize threading\n" )
- #ifdef _WIN32
- _setmode(_fileno(stdin), _O_BINARY);
- _setmode(_fileno(stdout), _O_BINARY);
- #endif
- GetConsoleTitle( originalCTitle, sizeof(originalCTitle) );
- /* Parse command line */
- if( parse( argc, argv, ¶m, &opt ) < 0 )
- ret = -1;
- /* Restore title; it can be changed by input modules */
- SetConsoleTitle( originalCTitle );
- /* Control-C handler */
- signal( SIGINT, sigint_handler );
- if( !ret )
- ret = encode( ¶m, &opt );
- /* clean up handles */
- if( filter.free )
- filter.free( opt.hin );
- else if( opt.hin )
- cli_input.close_file( opt.hin );
- if( opt.hout )
- cli_output.close_file( opt.hout, 0, 0 );
- if( opt.tcfile_out )
- fclose( opt.tcfile_out );
- if( opt.qpfile )
- fclose( opt.qpfile );
- SetConsoleTitle( originalCTitle );
- return ret;
- }
复制代码 |
|