当前位置:网站首页>C language learning log 12.5
C language learning log 12.5
2022-06-13 04:57:00 【Today is also a day without baldness】
One . Two dimensional array
Format :int a[x][y]: The representative definition has x That's ok y Columns of the matrix , It can also be y That's ok x Columns of the matrix , In order to conform to Linear Algebra , Generally, we think it is the first case .
Two . Array application :
eg: When an array is used as an argument in a function , Often you have to use another parameter to pass in the size of the array
3、 ... and .Sizeof:
An operator , Single purpose . In fact, it gets the storage space occupied by data in memory , Count in bytes
(1). For data types : Format :sizeof(type);
(2) For variables : Format :sizeof(name);
eg:sizeof Operators cannot be used with functions !!!
(3) As a result, : The integer is usually 4 Bytes , Single precision is also 4 individual , Double precision floating point numbers are 8 individual , The character type is generally 1 individual
Four . The pointer
& Is used to get the address of the variable , His operands must be variables . Is the address the same size as int About depends on compiler
int i; printf("%p",&i);
* Is a unary operator , The value of the variable used to access the address represented by the pointer variable , It can be an R-value or an l-value .
int k=*p; *p=k+1
Tips: An array in a function is a pointer, that is :
int *a And int a[] Equivalent
Array variables are special pointers , Its own expression address so
int a[10]; int*p=a // No need & Address fetch
But the elements of an array represent variables , Need to use & Address fetch
a == &a[0]
[] Operators can be used for arrays or pointers
p[0] <==> a[0]
* Operator can do , You can also do
*a =25;
The array variable is const The pointer to , So it can't be assigned
int a[] <==> int *const a=..
边栏推荐
- QT brushes and brushes
- Solution to sudden font change in word document editing
- C language exercise 1
- Use service worker to preferentially request resources - continuous update
- Chapter 13 abstraction: address space
- Simple-SR:Best-Buddy GANs for Highly Detailed Image Super-Resolution论文浅析
- rainbow
- [untitled]
- Advantages of win8.1 and win10
- Interpretation of QT keypressevent
猜你喜欢
[JS solution] leedcode 200 Number of islands
Avantages de win8.1 et win10
About mission planning and improving execution
Design system based on MVC using javeswingjdbc
RMQ、LCA
C language exercise 1
Several methods of identifying equivalent circuit of circuit drawing
Kaggle time series tutorial
[leetcode]- binary search
Ruoyi cloud startup tutorial (hand-held graphics)
随机推荐
Collection of some compatibility issues
About mission planning and improving execution
Createanonymousthreadx passes parameters to anonymous threads
Force buckle 25 A group of K flipped linked lists
How to handle async/await error messages gracefully
Handwritten promise and its method, with detailed notes
RuoYi-Cloud启动教程(手把手图文)
Third party comment plugin
The differences between the four startup modes of activity and the applicable scenarios and the setting methods of the two startup modes
Tita performance treasure: remote one-on-one discussion
【JS解决】leedcode 117. 填充每个节点的下一个右侧节点指针 II
Autumn wind, dust, youth
Infinite cycle scrolling code Alibaba international station store decoration code base map scrolling black translucent display effect custom content decoration code full screen display
PostgreSQL Guide: Insider exploration (Chapter 7 heap tuples and index only scanning) - Notes
PostgreSQL Guide: inside exploration (Chapter 10 basic backup and point in time recovery) - Notes
Section 4 - arrays
Section 6 - pointers
Keil uses j-link to burn the code, and an error occurs: Flash download failed - one of the "Cortex-M3" solutions
Draw a hammer
Shell variable learning notes