当前位置:网站首页>c语言问题
c语言问题
2022-07-29 05:24:00 【阿童沐游】
变量
可修饰变量关键词:
三大特点:
作用域:
生命周期:
存储区域:
数据类型:
类型之间的转换:
规则与优先级
基本数据类型
字符类型:
字符/字符串/
字符串函数
数组类型:
指针类型:
构造数据类型:
结构体与公用体区别:
字节对齐:
引出对指针的理解
定义:
作用:
内存空间大小
地址分为不同类型
常见指针类型:
多级指针:
作用与用法:
函数指针与指针函数(开启对函数的理解)
野指针:
定义:
产生问题:
内存泄漏问题:(理解内存泄漏)
注意事项
智能指针:
内存
内存分配图:
存储方式:
静态/动态:
存放的变量:
对象
分配与释放(malloc与free)
堆与栈区别:
静态存储区:(static关键词->关键词)
内存泄漏:
函数:
定义:
为什么使用函数:
函数的语法:
函数三要素:
函数的调用过程:
传值Vs传地址
返回值:
函数的可重入性
常用关键字(c/c++区别)
register:
作用:
原理:
场景:
与volatile对比:
volatile:
作用:
原理:
场景:
。。。
static:
。。。
与const区别:
const:
。。。
inline:
。。。
与#define区别(引出预处理,编译,汇编,链接)
#defineVs typedef
c语言编译过程
预处理:
任务:
头文件展开:
宏替换:
概念:
注意:
编译:
汇编:
链接:
位运算:
6种操作符
位操作使用技巧:
1.判断奇偶
2.交换两数
3.变化符合
4.求绝对值
位操作作用法
#include <stdio.h>
int my_strlen(char *str)
{
int count = 0;
while(*str != '\0')
{
count++;
str++;
}
return count;
}
int my_strcmp(char*des, char* str)
{
while(*des != '\0' && *str != '\0'&& *des == *str)
{
des++;
str++;
}
return *des - *str;
}
char *my_strcpy(char *des, char*str)
{
int i=0;
while(str[i] != '\0')
{
des[i] = str[i];
i++;
}
des[i] = '\0';
return des;
}
char *my_strcat(char*des, char*str)
{
}
void main(int argc, char *argv[])
{
char a[12];
printf("%d\n",my_strlen("hello"));
printf("%d\n",my_strcmp("hoo1","hoola"));
printf("%s\n",my_strcpy(a,"wwww"));
return ;
}边栏推荐
- STM32: mcnamu wheel tracking task (library function program code)
- Leetcode 283. move zero
- 爬取表情包
- Linked list -------------------------- tail insertion method
- Understanding of synchronized eight lock phenomenon
- MySql-面试题
- 无符号右移
- Add time series index to two-dimensional table
- LeetCode #977.有序数组的平方
- V-ray 5 ACEScg 工作流程设置
猜你喜欢

LeetCode #26.删除有序数组中的重复项

Add time series index to two-dimensional table

【软件工程之美 - 专栏笔记】13 | 白天开会,加班写代码的节奏怎么破?

LeetCode #14. 最长公共前缀

官方教程 Redshift 04 渲染参数

Simple code to realize PDF to word document

【Leetcode刷题】数组2——二分查找

UE4/UE5 C盘变大处理
![[beauty of software engineering - column notes] 17 | what is the need analysis? How to analyze?](/img/54/5ea29b125e3b871cd08d52ccc05d3a.png)
[beauty of software engineering - column notes] 17 | what is the need analysis? How to analyze?

LeetCode #283.移动零
随机推荐
LeetCode #35.搜索插入位置
Computer network interview questions
UE5 光影基础 阴影全解析 锯齿阴影解决方案 Lumen
2022暑初二信息竞赛学习成果分享2
UE4/UE5 C盘变大处理
Abstract encapsulation inheritance polymorphism
UE4 天光和反射球的原理和区别
数论:px+py 不能表示的最大数为pq-p-q的证明
位运算学习笔记
FPGA based: moving target detection (schematic + source code + hardware selection, available)
[beauty of software engineering - column notes] 20 | how to deal with the headache of requirement change?
【软件工程之美 - 专栏笔记】13 | 白天开会,加班写代码的节奏怎么破?
网络安全学习篇
官方教程 Redshift 03 各种GI的参数和常规使用说明
Redshift还原SP效果 - SP贴图导出设置及贴图导入配置
LeetCode #189.轮转数组
LeetCode #13. 罗马数字转整数
关于【链式前向星】的自学理解
利用云打码来破解登录遇到验证码的问题
#9196 肿瘤面积 题解