<a href="mailto:[email protected]">[email protected]</a>
<a href="http://blog.csdn.net/54powerman">http://blog.csdn.net/54powerman</a>
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("%0.6d",10);
printf("%7.6d",10);
printf("%-7.6d",10);
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.";
編譯:c++ -o demo.exe Demo.cpp
測試:demo.exe