C++/C
文章平均质量分 55
香 浓
这个作者很懒,什么都没留下…
展开
-
C++learning
//常量宏#define PI 3.14#define STU_COUNT 102//宏模拟函数#define ARRDY_SIZE(a) sezeof(a)/sizeof(a[0])// 控制宏 declaration vs. definition/* 头文件定义#ifndef TEST_H#define TEST_Hstruct A{int i;};#endif*/// 头文件中若要调用C中的函数/*#ifdef __cplusplusextern "C"{#end原创 2021-05-20 22:34:41 · 231 阅读 · 0 评论 -
MIPS汇编伪指令(Directives)
.globlDeclare the listed label(s) as global to enable referencing from other files.globl symbol意为symbol全局可见.type.type name,@type:将符号name的type属性设为type。其中type可以是function或object.type似乎不是MIPS的伪指令而是arm的更多详见.ent .endThese directives mark the start and原创 2021-05-17 20:57:16 · 1704 阅读 · 4 评论 -
位运算对位进行操作
操作要求:某些位保留,某些位清零被操作数a,操作数b在a中需要保留的位在b中置0,在a中需要清零的位在b中置0。操作:(a | b) ^ b原创 2021-05-17 19:24:43 · 189 阅读 · 0 评论 -
C++中的const,位置很关键
const修饰成员变量修饰基本变量const int a完全等价于int const a修饰指针指针常量:const int * ptr等价于int const * ptr,不可以改变ptr所指向的内存区域的值,即*ptr = 1;错误;ptr = &b,可以。常量指针:int * const ptr = &a,必须初始化,不可以改变ptr指针自身,即*ptr = 1;可以;ptr = &b;错误。修饰引用要知道,引用本身有以下特性:不存在空引用。引用必须连接到一块原创 2021-04-26 20:07:31 · 763 阅读 · 0 评论