当前位置:网站首页>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 ;
}
边栏推荐
- Pat class a 1146 topology sequence
- 在js中,0表示false,非0表示true
- Solve the problem that the disk is full due to large files
- UPC little C's King Canyon
- Pytorch's skill record
- 黑盒测试常见错误类型说明及解决方法有哪些?
- Strongly connected component
- 10 practical uses of NFT
- [paper reading] tomoalign: a novel approach to correcting sample motion and 3D CTF in cryoet
- [paper reading | cryoet] gum net: fast and accurate 3D subtomo image alignment and average unsupervised geometric matching
猜你喜欢
[introduction to cryoelectron microscopy] Caltech open class course notes part 3:image formation
The new generation of public chain attacks the "Impossible Triangle"
Jump from mapper interface to mapping file XML in idea
[experience] relevant configuration of remote connection to intranet server through springboard machine
RoBERTa:A Robustly Optimized BERT Pretraining Approach
Compare three clock circuit schemes of single chip microcomputer
[freeze electron microscope] analysis of the source code of the subtomogram alignment function of relion4.0 (for self use)
《nlp入门+实战:第五章:使用pytorch中的API实现线性回归》
技术分享| 快对讲综合调度系统
2022 Shenzhen Cup Title A: get rid of "scream effect" and "echo room effect" and get out of the "information cocoon room"
随机推荐
As long as flutter is data, it will be judged null
Volatile keyword parsing of C #
[flask introduction series] installation and configuration of flask Sqlalchemy
在js中,0表示false,非0表示true
Multi thread shopping
[untitled] format save
[cryoelectron microscope] relion4.0 pipeline command summary (self use)
Database persistence +jdbc database connection
In JS, 0 means false, and non-0 means true
Tcp/ip five layer reference model and corresponding typical devices and IPv6
@Use of jsonserialize annotation
关于pip升级损坏导致的问题记录
MySQL 45 | 08 is the transaction isolated or not?
Sort out the two NFT pricing paradigms and four solutions on the market
[WPF] realize language switching through dynamic / static resources
Useful websites
Starting process of raspberry pie
The difference between static library and dynamic library of program
准备esp32环境
Sqlmap (SQL injection automation tool)