会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
朱小勇
博客园
园子
首页
新随笔
联系
管理
订阅
上一页
1
···
44
45
46
47
48
49
50
51
52
···
133
下一页
2021年7月19日
C++使用原子变量
摘要: 1、C++给我们typedef了很多原子变量 /// atomic_bool typedef atomic<bool> atomic_bool; /// atomic_char typedef atomic<char> atomic_char; /// atomic_schar typedef at
阅读全文
posted @ 2021-07-19 18:01 朱小勇
阅读(1471)
评论(0)
推荐(0)
2021年7月18日
C语言运算符优先级
摘要: 如下: 优先级 运算符 名称或含义 使用形式 结合方向 说明 1 [] 数组下标 数组名[常量表达式] 左到右 () 圆括号 (表达式)/函数名(形参表) . 成员选择(对象) 对象.成员名 -> 成员选择(指针) 对象指针->成员名 2 - 负号运算符 -表达式 右到左 单目运算符 (类型) 强制
阅读全文
posted @ 2021-07-18 17:39 朱小勇
阅读(195)
评论(0)
推荐(0)
C\C++编译流程
摘要: 总流程: 1.预处理(Preprocessing) 预处理用于将所有的#include头文件以及宏定义替换成其真正的内容; 将hello.c预处理输出hello.i文件 2.编译(Compilation) 将经过预处理之后的程序转换成特定汇编代码(assembly code)的过程; 在这个阶段中,
阅读全文
posted @ 2021-07-18 16:39 朱小勇
阅读(318)
评论(0)
推荐(0)
2021年7月17日
C语言从键盘输入字符串存储文本#作为结束符
摘要: 代码: #include <stdio.h> #include <string.h> #define N 1024 int main(int argc, char* argv[]) { FILE* fp; fp = fopen("file.txt", "w"); if(!fp){ printf("f
阅读全文
posted @ 2021-07-17 14:46 朱小勇
阅读(466)
评论(0)
推荐(0)
C/C++输入输出
摘要: 一、C语言: 1、输入 ①、scanf 遇到空格、回车和Tab键停止; 自动在输入字符串末尾加结束符; #include <stdio.h> int main(void){ int a,b,c; printf("input a,b,c\n"); scanf("%d%d%d",&a,&b,&c); p
阅读全文
posted @ 2021-07-17 14:15 朱小勇
阅读(438)
评论(0)
推荐(0)
C语言对字符串循坏左移m次
摘要: 代码: #include <stdio.h> #include <string.h> #define N 1024 char* fun(char* str, int m) { int totalLength = strlen(str); static char ret[N]; memset(ret,
阅读全文
posted @ 2021-07-17 14:01 朱小勇
阅读(104)
评论(0)
推荐(0)
C/C++返回局部变量
摘要: 原则: 能否正常返回这个值,要看这个值的内容或指向的内容是否被回收,导致空指针或者真实内容被擦除。【一旦返回值有指针或者地址,就需要着重考虑,而返回一个值是一般都可以的,可参考C++的临时变量】 下面对不同情况说明。 1、返回指向常量的指针 #include <stdio.h> char *retu
阅读全文
posted @ 2021-07-17 13:33 朱小勇
阅读(560)
评论(0)
推荐(0)
C语言题-输入一串字符,统计单词个数
摘要: 代码: #include <stdio.h> #include <string.h> #define bool char #define N 1024 #define W 64 bool isWord(char word[], int length) { bool ret = 1; int i; f
阅读全文
posted @ 2021-07-17 00:15 朱小勇
阅读(931)
评论(0)
推荐(0)
C语言流程图
摘要: 1、图形 2、实例 2.1、 2.2、
阅读全文
posted @ 2021-07-17 00:12 朱小勇
阅读(3133)
评论(0)
推荐(0)
2021年7月16日
C字符数组初始化方式
摘要: 一般声明之后要初始化全为0,如下: #define ARRAY_SIZE_MAX (1*1024*1024) void function1() { char array[ARRAY_SIZE_MAX] = {0}; //声明时使用{0}初始化为全0,'\0'的码就是0 } void function
阅读全文
posted @ 2021-07-16 23:47 朱小勇
阅读(545)
评论(0)
推荐(0)
上一页
1
···
44
45
46
47
48
49
50
51
52
···
133
下一页
公告