C/C++文件编译小工具
时间:2011-04-24 来源:吕飞
#include <direct.h> #include <stdlib.h> #include <stdio.h> #include <string.h> void main( void ) { char buffer[_MAX_PATH]; char split[]="\\"; char file[256]; char command[_MAX_PATH]="cmd /c gcc "; /* Get the current working directory: */ if( _getcwd( buffer, _MAX_PATH ) == NULL ) perror( "_getcwd error " ); else printf( "%s\n ", buffer ); strcat(buffer,split); strcat(command,buffer); scanf("%s",&file); strcat(command,file); system(command ); printf("%s",command); scanf("%s",&file); }
相关阅读 更多 +