54powerman@163.com
http://blog.csdn.net/54powerman
1 设置GCC命令行使用环境变量:
SET GCC_HOME=E:/MinGW
SET PATH=%PATH%;GCC_HOME
SET LIBRARY_PATH=%GCC_HOME%/lib
SET C_INCLUDE_PATH=%GCC_HOME%/include
SET CPLUS_INCLUDE_PATH=%GCC_HOME%/include/c++/3.4.2;%GCC_HOME%/include/c++/3.4.2/mingw32;%GCC_HOME%/include/c++/3.4.2/backward;%GCC_HOME%/include
2 Demo.c
#include <stdio.h>
int main()
{
printf("%6d",10);
printf("|/n");
printf("%-6d",10);
printf("|/n");
printf("%0.6d",10);
printf("|/n");
printf("%7.6d",10);
printf("|/n");
printf("%-7.6d",10);
printf("|/n");
return 0;
}
编译gcc -o demo.exe Demo.c
测试:demo.exe
3 Demo.cpp
#include <iostream>
int main(int argc, char* argv[])
{
std::cout << "Hello world./nBye.";
return 0;
}
编译:c++ -o demo.exe Demo.cpp
测试:demo.exe