当前位置:网站首页>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 ;
}边栏推荐
- 2022 Shenzhen Cup Title A: get rid of "scream effect" and "echo room effect" and get out of the "information cocoon room"
- Solve the problem that the disk is full due to large files
- In an SQL file, a test table and data are defined above, and you can select* from the test table below
- Mutationobserver document learning
- Android interview question | how to write a good and fast log library?
- 在js中,0表示false,非0表示true
- LVM logical volume group management
- Zero technology is deeply involved in the development of privacy computing financial scenario standards of the ICT Institute
- [freeze electron microscope] analysis of the source code of the subtomogram alignment function of relion4.0 (for self use)
- Access数据库引入datagridview数据后,显示错误
猜你喜欢

Realize the effect of changing some colors of a paragraph of text

How to draw an excellent architecture diagram

LANDSCAPE

Zero technology is deeply involved in the development of privacy computing financial scenario standards of the ICT Institute

Autojs微信研究:微信自动发送信息机器人最终成品(有效果演示)

Useful websites

Convert source package to RPM package

IonIcons图标大全

10 common software architecture modes
![[cryoEM] Introduction to FSC, Fourier shell correlation](/img/01/6a4f6041444abfd1d3ca7e0c14b524.png)
[cryoEM] Introduction to FSC, Fourier shell correlation
随机推荐
Very practical shell and shellcheck
工业互联网行至深水区,落地的路要怎么走?
Measured waveform of boot capacitor short circuit and open circuit of buck circuit
Halcon installation and testing in vs2017, DLL configuration in vs2017
What are the common error types and solutions of black box testing?
Actual measurement of boot and pH pins of buck circuit
Record of problems caused by PIP upgrade damage
Realize the effect of changing some colors of a paragraph of text
mysql 使用 DATE_FORMAT(date,'%Y-%m')
Resize2fs: bad magic number in super block
Solve the problem that the disk is full due to large files
黑盒测试常见错误类型说明及解决方法有哪些?
[flask introduction series] installation and configuration of flask Sqlalchemy
Amaze UI 图标查询
[experience] relevant configuration of remote connection to intranet server through springboard machine
The difference between static library and dynamic library of program
Pytest set (7) - parameterization
Chaos and future of domestic digital collections
postman接口测试|js脚本之阻塞休眠和非阻塞休眠
QT connects two qslite databases and reports an error qsqlquery:: exec: database not open