当前位置:网站首页>C language problems
C language problems
2022-07-29 07:56:00 【A tong Muyou】
Variable
Modifiable variable keywords :
Three characteristics :
Scope :
Life cycle :
Storage area :
data type :
Conversion between types :
Rules and priorities
Basic data type
Character type :
character / character string /
String function
An array type :
Pointer types :
Construct data types :
The difference between structure and common body :
Byte alignment :
Lead to the understanding of pointer
Definition :
effect :
Memory size
Addresses are divided into different types
Common pointer types :
Multi level pointer :
Function and usage :
Function pointer and pointer function ( Open the understanding of functions )
Wild pointer :
Definition :
A problem :
Memory leak problem :( Understanding memory leaks )
matters needing attention
Intelligent pointer :
Memory
Memory allocation diagram :
storage :
static state / dynamic :
Stored variables :
object
Distribution and release (malloc And free)
The difference between heap and stack :
Static storage area :(static key word -> key word )
Memory leak :
function :
Definition :
Why use functions :
Syntax of functions :
Three elements of the function :
Calling procedure of function :
Pass value Vs Address
Return value :
Reentrancy of functions
Common keywords (c/c++ difference )
register:
effect :
principle :
scene :
And volatile contrast :
volatile:
effect :
principle :
scene :
...
static:
...
And const difference :
const:
...
inline:
...
And #define difference ( Export preprocessing , compile , assembly , link )
#defineVs typedef
c Language compilation process
Preprocessing :
Mission :
Header file expansion :
Macro replace :
Concept :
Be careful :
compile :
assembly :
link :
An operation :
6 Operators
Bit operation tips :
1. Judge parity
2. Exchange two numbers
3. Changes conform to
4. Find the absolute value
Bit operation method
#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 ;
}
边栏推荐
- How to draw an excellent architecture diagram
- [dry goods memo] 50 kinds of Matplotlib scientific research paper drawing collection, including code implementation
- Measured waveform of boot capacitor short circuit and open circuit of buck circuit
- postman接口测试|js脚本之阻塞休眠和非阻塞休眠
- In an SQL file, a test table and data are defined above, and you can select* from the test table below
- Zero technology is deeply involved in the development of privacy computing financial scenario standards of the ICT Institute
- 在一个sql文件中,上面定义一个测试表及数据,下面可以select* from 测试表
- 智慧城市的应用挑战,昇腾AI给出了新解法
- Write some DP
- Do you want to meet all the needs of customers
猜你喜欢
Sqlmap (SQL injection automation tool)
What are the common error types and solutions of black box testing?
技术分享| 快对讲综合调度系统
[freeze electron microscope] analysis of the source code of the subtomogram alignment function of relion4.0 (for self use)
Ionicons icon Encyclopedia
Halcon installation and testing in vs2017, DLL configuration in vs2017
The smallest positive number that a subset of an array cannot accumulate
mysql 使用 DATE_FORMAT(date,'%Y-%m')
Excellent urban design ~ good! Design # visualization radio station will be broadcast soon
Day 014 二维数组练习
随机推荐
在js中,0表示false,非0表示true
Write some DP
Effective learning of medical image segmentation annotation based on noise pseudo tags and adversarial learning
Jump from mapper interface to mapping file XML in idea
LANDSCAPE
CDM - code division multiplexing (easy to understand)
Record of problems caused by PIP upgrade damage
330. Complete the array as required
Pytorch's skill record
Detailed explanation of the find command (the most common operation of operation and maintenance at the end of the article)
Pat class a 1146 topology sequence
How to get to the deep-water area when the industrial Internet goes?
Useful websites
How to draw an excellent architecture diagram
MapReduce steps of each stage
Strongly connected component
20 hacker artifacts
207. Curriculum
How to connect VMware virtual machine to external network under physical machine win10 system
cs61abc分享会(六)程序的输入输出详解 - 标准输入输出,文件,设备,EOF,命令行参数