05 2020 档案
struct 对齐机制定义
摘要:一般来说,结构体变量占据的内存大小是所有成员变量占据内存大小的总和,但有些例外,需要特别注意。 1、结构体变量的首地址能够被其最宽的基本类型成员的大小所整除。 2、结构体每个成员相对于结构体首地址的偏移量,都是成员大小的整数倍。。 3、结构体的总大小为结构体最宽基本类型成员的大小的整数倍。 字节对齐
阅读全文
posted @ 2020-05-19 23:58
ヤ玥夜ゞ
struct 中数组成员在外部无法赋值
摘要:#include <iostream> #include<cstring> int main() { using namespace std; struct computer { char brand[20]; float price; }com1 = { "Dell",5000 }, com2;
阅读全文
posted @ 2020-05-19 22:19
ヤ玥夜ゞ
IsProcessorFeaturePresent 获取处理器信息
摘要:#include <iostream> #include <Windows.h> #include <TCHAR.h> int main() { if(IsProcessorFeaturePresent(PF_3DNOW_INSTRUCTIONS_AVAILABLE)) printf("当前CPU支
阅读全文
posted @ 2020-05-12 23:44
ヤ玥夜ゞ
GetAsyncKeyState 获取键盘按键消息
摘要:1 #include <Windows.h> 2 #include <iostream> 3 using namespace std; 4 5 int main() 6 { 7 while(true) 8 { 9 if(-32767 == GetAsyncKeyState('A')) //不支持大小
阅读全文
posted @ 2020-05-08 02:33
ヤ玥夜ゞ
浙公网安备 33010602011771号