随笔分类 -  代码

摘要:线程有四种状态:新生状态、可运行状态、被阻塞状态、死亡状态。 多线程的几种实现方法 继承 Thread 类 实现 Runnable 接口再 new Thread #include <stdio.h> #include <pthread.h> #include <Windows.h> static i 阅读全文
posted @ 2023-10-18 17:27 邹木木 阅读(6) 评论(0) 推荐(0) 编辑
摘要:int b = 0x1; printf("%x\n", b | 0x3); //01 | 11 = 11 位运算或 //01 & 11 = 01 位运算与,有0为0,全1为1 阅读全文
posted @ 2023-09-17 23:10 邹木木 阅读(21) 评论(0) 推荐(0) 编辑
摘要:int* test(int a, char b) { printf("%d\n", a); } void test1(int a) { printf("%d\n", a * a); } void test2(int a) { printf("%d\n", a * 5); } int main() { 阅读全文
posted @ 2023-09-17 22:56 邹木木 阅读(12) 评论(0) 推荐(0) 编辑
摘要:class Test { public: char *a; Test() { this->a = (char *)malloc(10);//this->a表示对象自身的成员a strcpy_s(this->a, 10, "hello"); printf("Test init\n"); } ~Test 阅读全文
posted @ 2023-09-17 22:56 邹木木 阅读(4) 评论(0) 推荐(0) 编辑