上一页 1 2 3 4 5 6 7 8 9 10 ··· 18 下一页
摘要: 这里用go to 来模拟汇编他们的区别 while 代码 int i = 0; while (i < 100) { i++; } goto 实现while int i = 0; WHILE_BEGIN: if (i < 100) { goto WHILE_END; } i++; goto WHILE 阅读全文
posted @ 2021-04-17 11:25 紅人 阅读(107) 评论(0) 推荐(0)
摘要: if使用优化一般是 知道数据样本分布 例如学生成绩 int main() { int i = 10; if (i <= 100 && i>90) { } else if(i <80&&i<90) { } else if (i < 60 && i < 80) { } //如此类推 return 0; 阅读全文
posted @ 2021-04-17 10:44 紅人 阅读(499) 评论(0) 推荐(0)
摘要: 什么是柔性别数组 结构中的最后一个元素允许是未知大小的数组,这就叫做柔性数组成员 例如 typedef struct st_type { int i; int a[0]//柔性数组成员可以调整数组大小 }type_a; 使用方法 struct S { int n; int arr[]; }; int 阅读全文
posted @ 2021-04-15 16:00 紅人 阅读(100) 评论(0) 推荐(0)
摘要: 什么是位段 段位的声明的结构类似,有两个不同: 1.位段的成员必须是int,unsigned int 或者signed int只要是整形就可以. 2.位段的成员名后边有一个冒号和一个数字 例如 struct S { int a : 2; int b : 5; int c : 10; int d : 阅读全文
posted @ 2021-04-15 08:43 紅人 阅读(163) 评论(0) 推荐(0)
摘要: 0x01为什么存在动态内存分配 我们已经掌握的内存开辟方式有: int val=20;//在栈空间上开辟四个字节 char arr[10]={0};//在栈空间上开辟10个字节连续空间 但是上述的开辟空间方式有2个特点 1.空间开辟大小固定 2.数组在声明的时候,必须指定数组长度,它所需要的内存在编 阅读全文
posted @ 2021-04-14 20:41 紅人 阅读(178) 评论(0) 推荐(0)
摘要: 0x00简介 首先要知道结构体的对齐规制 1.第一个成员在结构体变量偏移量为0的地址处 2.其他成员变量对齐到某个数字的整数倍的地址处 对齐数=编辑器默认的一个对齐数与该成员大小的较小值 vs中默认的值为8 gcc 没有默认就是累加 3.结构体总大小为最大对齐数(每个成员变量都有一个对齐数)的整数倍 阅读全文
posted @ 2021-04-13 20:00 紅人 阅读(620) 评论(0) 推荐(0)
摘要: 0x01隐藏 当我们同时编译多个文件时,所有未加 static 前缀的全局变量和函数都具有全局可见性。为理解这句话,我举例来说明。我们要同时编译两个源文件,一个是 a.c,另一个是 main.c。 下面是 a.c 的内容: char a = 'A'; // global variable void 阅读全文
posted @ 2021-04-13 16:25 紅人 阅读(165) 评论(0) 推荐(0)
摘要: char * Mystrtok(char * string, const char * control) { unsigned char *str; const unsigned char *ctrl = (const unsigned char *)control; //注意这里使用了static 阅读全文
posted @ 2021-04-13 08:04 紅人 阅读(254) 评论(0) 推荐(0)
摘要: void * Mymemcpy(void * dest ,const void *src ,size_t count) { void *temp = dest; if (dest< src) { while (count--) { *(char *)dest = *(char *)src; ++(c 阅读全文
posted @ 2021-04-13 07:40 紅人 阅读(282) 评论(0) 推荐(0)
摘要: void * Mymemcpy(void * dest ,const void *src ,size_t count) { void *temp = dest; while (count--) { *(char *)dest = *(char *)src; ++(char *)src; ++(cha 阅读全文
posted @ 2021-04-13 07:09 紅人 阅读(214) 评论(0) 推荐(0)
摘要: int * Mystrstr(const char * str1, const char* str2) { char* p1 = NULL; char * p2 = NULL; char * cur = (char *)str1; if (*p2=='\0') { return cur; } whi 阅读全文
posted @ 2021-04-12 18:39 紅人 阅读(128) 评论(0) 推荐(0)
摘要: char * Mystrncat(char * front, const char *back, size_t count) { char *temp = front; while (*front++) {} front--; while (count--) { if (!(*front++ = * 阅读全文
posted @ 2021-04-12 18:11 紅人 阅读(104) 评论(0) 推荐(0)
摘要: char * Mystrncpy(char * dest, const char *src,size_t count) { char *temp = dest; while (count&(*dest++ = *src++)) { count--; } if (count) { while (--c 阅读全文
posted @ 2021-04-12 17:52 紅人 阅读(227) 评论(0) 推荐(0)
摘要: int * Mystrcmp(const char * str1, const char *str2) { while (*str1++ == *str2++) { if (*str1=='\0') { return 0; } if (*str1!= *str2) { if (*str1 > *st 阅读全文
posted @ 2021-04-12 17:34 紅人 阅读(308) 评论(0) 推荐(0)
摘要: char * Mystrcat(char * dest, const char * src) { char * temp = dest; while (*dest !='\0')//一直到字符串末尾\0 { dest++; } while (*dest++= *src++)//开始拷贝 { } re 阅读全文
posted @ 2021-04-12 16:33 紅人 阅读(147) 评论(0) 推荐(0)
摘要: 有返回值的官方写法 char * Mystrcpy(char * dest,const char *str) { char *temp = dest; while (*dest++ = *str++) {} return temp; } 无返回值 直接拷贝到第一个参数位置 void Mystrcpy 阅读全文
posted @ 2021-04-12 16:20 紅人 阅读(138) 评论(0) 推荐(0)
摘要: size_t Mystrlen(const char* str) {int count = 0; while (*str) { str++; count++; } return count; } 如果要进行字符串长度比较,这里也可以修改返回类型改为int 防止无符号的负数比较。 阅读全文
posted @ 2021-04-12 15:53 紅人 阅读(133) 评论(0) 推荐(0)
摘要: ☉C for,while,do while 代码实现 ☉C switch 和if性能优化区别 ☉C 柔性数组 ☉C 位段使用 ☉C 动态内存分配 ☉C 结构体内存对齐详解 ☉C static静态变量使用研究 ☉C常用函数自实现 ☉C 数据存储原码,补码,反码计算 补充中... 阅读全文
posted @ 2021-04-10 14:42 紅人 阅读(168) 评论(0) 推荐(0)
摘要: Download the source code first In the directory espcms_web\espcms_load.php line 67 if (!is_file($module_filename)) { espcms_message_err('public_pack-e 阅读全文
posted @ 2019-11-22 11:25 紅人 阅读(721) 评论(1) 推荐(1)
摘要: 0x00简介 项目名称:ESPCMS-P8(易思企业建站管理系统) 测试平台:Windwos 版本信息:P8.19082801稳定版 更新时间:2019-08-30 00:56:32 网站官网:https://www.earclink.com/ 审计时间:2019-11-2 23:07:00 代码行 阅读全文
posted @ 2019-11-05 11:17 紅人 阅读(1066) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 10 ··· 18 下一页