- 博客(6)
- 收藏
- 关注
原创 控制台程序在点CMD窗口的叉关闭时做了什么事?
RT:比如下面的程序,我如何在点叉结束时,调用postProc函数:int postProc(){printf("结束\n");return 0;}int main(){for(;;){printf("进行中\n");Sleep(1);}return 0;}#include <stdio.h>#include <windows.h>BOOL WINAPI HandlerRoutine(DWORD dwCtrlType){ if(.
2022-03-25 14:25:56
214
原创 如何定义一个带返回值的宏函数
#include <Windows.h>#include <stdio.h>#define DIO_SLOT_MAX 32#define CONV_SLOT_BIT_TO_IDX(slotBit) \({ \ ULONG idx = 0; \ for (idx.
2022-03-14 17:36:41
4989
原创 const 引用
#include <string> #include <iostream> using namespace std; int main() { double val = 3.14; const double &ref1 = val; //const double const *ref1 = &val; const int &ref2 = val; //int temp = val; const int &...
2022-03-08 10:42:29
212
原创 makefile 传递宏
方法1:makefield如下,为了使宏生效在命令行编译时 执行make "CXXFLAG += -DDEBUG"CXX = g++ifdef CXXFLAGCXXFLAG +=elseCXXFLAG = -Wall -gCXXFLAG += -DDEBUGendifLDFLAGS +=INCS = -I../incSRCS = ./BUILDDIR = ./LIBS += -L../lib/MAINSRCS = $(foreach dir,${shell find...
2021-12-24 14:20:21
1907
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人