“C++”目录存档

#pragma once与 #ifndef的区别

2008年11月26号,星期三

为了避免同一个文件被include多次
1   #ifndef方式
2   #pragma once方式
在能够支持这两种方式的编译器上,二者并没有太大的区别,但是两者仍然还是有一些细微的区别。

(全文…)

no newline at end of file

2008年11月2号,星期天

GCC中如果文件最后不加上一行空行的话,就会冒个warning:no newline at end of file。

在《Rationale for the C99 standard》一文中,有C99的相关信息:

A backslash immediately before a newline has long been used to continue string literals, as well as preprocessing command lines. In the interest of easing machine generation of C, and of transporting code to machines with restrictive physical line lengths, the C89 Committee generalized this mechanism to permit any token to be continued by interposing a backslash/newline sequence.

(全文…)

Boost与MinGW

2008年11月2号,星期天

今天突然来了兴致,下了个Boost来玩。与其说不用用这个Boost,倒不如说还没有了解,所以搜了一大堆资料,在Boost 中文站逗留了很久,由于我的编译器是MinGW,我郁闷的是到底要怎样才能让MinGW能用上Boost的库呢?在我百思不得其解的情况下,用了一个很傻的方法,就是将Boost下了的解压包里那个boost文件夹复制到MinGW里的include里面,虽然不知道具体Boost有多强大,不过这个方法跟我在网上搜到的资料感觉很不一样的~看到有人说要编译成库,什么意思呢????

(全文…)