#define DEBUG_ENABLE
#ifdef DEBUG_ENABLE
#define DPRINT(fmt, args...) fprintf(stderr, "[DPRINT...][%s %d] "fmt"\n", __FILE__, __LINE__, ##args);
#else
#define DPRINT(fmt, ...)
#endif...
分类:
其他好文 时间:
2014-11-26 11:26:15
阅读次数:
263
#ifdef__cplusplusexternC{}与C和C++间的关系1.1问题是什么解决在1.在一个系统中.cpp文件的函数需要调用.c文件的函数,及需要gcc和g++编译的文件或文件的部分函数在同一个头文件中。的情况下,如何正确的编译、链接。1.2基础知识CompiletheCcodelikethis:gcc-c-osomecode.osome..
分类:
编程语言 时间:
2014-11-25 18:55:18
阅读次数:
201
1.常用宏或函数的实现_T,_L宏:#define unsigned short L#define _T(x) __T(x)#define _TEXT(x) __T(x)#ifdef _UNICODE#define __T(x) L##x #else#define __T(x) x #endif#d...
分类:
其他好文 时间:
2014-11-24 20:44:38
阅读次数:
261
#includeint main (){ #ifdef ONLINE_JUDGE #else freopen ("in.txt","r",stdin); #endif int n,i; while(scanf("%d",&n)!=EOF){ int a[n],s=1; for ...
分类:
其他好文 时间:
2014-11-23 23:01:45
阅读次数:
171
#includeint main (){ #ifdef ONLINE_JUDGE #else freopen ("in.txt","r",stdin); #endif int n,m; int a[101]; while(scanf("%d",&n)!=EOF&&(na[k+1])...
分类:
其他好文 时间:
2014-11-23 22:52:28
阅读次数:
245
#ifdef CONFIG_USE_IRQ
/* IRQ stack memory (calculated at run-time) */
.globl IRQ_STACK_START
IRQ_STACK_START:
.word 0x0badc0de
/* IRQ stack memory (calculated at run-time) */
.globl FIQ...
分类:
其他好文 时间:
2014-11-23 17:38:37
阅读次数:
214
char与TCHAR相互转化char strUsr[10] = "Hello";TCHAR Name[100];#ifdef UNICODE MultiByteToWideChar(CP_ACP, 0, strUsr, -1, Name, 100);#else strcpy(Name, ...
分类:
其他好文 时间:
2014-11-21 20:09:06
阅读次数:
180
1.#ifdef和#if defined
注意两者都有个define的作用,区别在于使用方式上。前者的通常用法是:
#ifdef X
....
#else
....
#endif
只能在两者中选择是否有定义。对于后者,常用法是:
#if defined x1
....
#elif defined x2
....
#elif de...
分类:
其他好文 时间:
2014-11-21 16:21:03
阅读次数:
131
assert很多时候到会用到,下面了解下assert的实现和用法在C标准库中,assert的实现是用宏来实现的,并不是用函数,它在#include这标准C头文件1、实现:宏assert是如何实现的呢?可以查看assert.h的代码,我查看的是mingw中的代码#undef assert#ifdef ...
分类:
其他好文 时间:
2014-11-17 17:28:54
阅读次数:
135
1、编写DLL a)文件--打开--新建项目--Win32,右侧Win32项目,填写好项目名称,点击“下一步”, 应用程序类型选择:“DLL(D)”,附加选项:空项目(E),然后完成。 b)编写头文件(edrlib.h):#ifdef__cplusplus#defineEXPORTextern"C"...
分类:
编程语言 时间:
2014-11-17 09:11:22
阅读次数:
194