c++嵌套注释是有问题的/*dkfksinti=0;/*lsdfkintj=0;*/inth=0;*/如果#if(0)inti=0;intj=0;inth=0;#endif利用预处理的方式,从逻辑上注释代码
分类:
编程语言 时间:
2014-07-23 13:44:17
阅读次数:
170
1.#define保护
使用#define防止头文件被多重包含。命名格式为:___H_
例如,foo中的头文件foo/src/bar/baz.h
#ifndef FOO_BAR_BAZ_H_
#define FOO_BAR_BAZ_H_
...
#endif //FOO_BAR_BAZ_H_
2.头文件依赖
使用前置声明尽量减少.h文件中#include的数量。
头文件被...
分类:
编程语言 时间:
2014-07-23 13:17:05
阅读次数:
234
??
1.打印二进制机器码(分别表示32位的和64位的)
#include
/*按照8位的长度打印一个数值*/
void dis8bit(char val)
{
int bit = 8;
while(bit--)
{
if(1
printf("1");
...
分类:
其他好文 时间:
2014-07-22 23:48:57
阅读次数:
408
5. Xcode工程在c++和OC混合编程时 NSObjCRuntime ERROR,解决办法是在混合编程的头文件中采用#if __OBJC__ #endif 包含头文件,比如:? #ifdef __OBJC__ #import "GCHelper.h" #import "LBS.h" #endif...
分类:
编程语言 时间:
2014-07-22 09:06:05
阅读次数:
200
lib/pathalloc.c#include "apue.h"#include #include #ifdef PATH_MAXstatic int pathmax = PATH_MAX;#elsestatic int pathmax = 0;#endif#define SUSV3 200112L...
分类:
其他好文 时间:
2014-07-19 19:34:54
阅读次数:
280
lib/openmax.c#include "apue.h"#include #include #ifdef OPEN_MAXstatic long openmax = OPEN_MAX;#elsestatic long openmax = 0;#endif/* * If OPEN_MAX is i...
分类:
其他好文 时间:
2014-07-18 23:36:31
阅读次数:
279
先来看段儿代码: protected void Page_Load(object sender, EventArgs e){#if DEBUG Response.Write("Debug Information! ");#endif Response.Write("Normal Informatio...
分类:
其他好文 时间:
2014-07-18 21:10:56
阅读次数:
140
1. #if defined #endif #if defined ( POWER_SAVING ) osal_pwrmgr_device( PWRMGR_BATTERY ); #endif #if (**) {语句##;} #endif 如果(**...
分类:
编程语言 时间:
2014-07-18 00:35:41
阅读次数:
260
多个DW进行update//菜鸟代码dw_1.Update()dw_2.Update()初级代码IFdw_1.Update()=1Anddw_2.Update()=1THENCOMMIT;ELSEROLLBACK;ENDIF中级代码IFdw_1.Update()=1THENIFdw_2.Update()=1THENCOMMIT;ELSEMessageBox("提示","喝多了!")ROLLBACK;ENDIFELSEMessageBox("提示","喝多了!..
分类:
其他好文 时间:
2014-07-16 16:24:58
阅读次数:
238
一、非MFC程序可以用以下方法检测内存泄露:1. 程序开始包含如下定义:#ifdef _DEBUG#define DEBUG_CLIENTBLOCK new( _CLIENT_BLOCK, __FILE__, __LINE__)#else#define DEBUG_CLIENTBLOCK#endif...
分类:
其他好文 时间:
2014-07-16 15:08:37
阅读次数:
295