c++

Visual Studio 命令提示字元 (2010)

Visual Studio 2010 Express提供了一個簡單的C++編譯環境:『Visual Studio 命令提示字元 (2010)』。
開啟後的終端機環境中可以用『cl』命令來編譯連結一般的C++程式。如:

cl hello.cpp

glut的程式(在glut有正確安裝後)也可以直接編譯。
不過如果要編譯WIN32的程式,在命令列則要加上kernel32.lib,user32.lib,gdi32.lib等額外的程式庫以供連結:

Indent style for my C++ coding

I prefer to indent my code with TABs. Some people do not like that because a TAB can represent different amount of spaces in different editors or viewers. However, I like TABs for their semantic meaning of levels of grouping. How a code editor or viewer displays this grouping information should be left to the liking of its user. And, using two spaces (or four) is just wasting an extra character when we can just set the TAB size to 2 (or 4). I also favor compactness and readability. It's desirable to make the code visually shorter as long as it remains readable.

Subscribe to RSS - c++