当前位置:网站首页>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=..
边栏推荐
- Clause 33: decltype is used for auto & type formal parameters, with std:: forward
- [JS solution] leedcode 200 Number of islands
- Your one-on-one meetings are inefficient. You can do this!
- C disk lossless move file
- Chapter 17 free space management
- C#获取WebService接口的所有可调用方法[WebMethod]
- Conception d'un système basé sur MVC avec javaswing JDBC
- 约瑟夫问题
- Brick story
- QT interface rendering style
猜你喜欢
OpenCV中的saturate操作(饱和操作)究竟是怎么回事
Configuration used by automatic teaching evaluation script
约瑟夫问题
Chapter 13 abstraction: address space
Section 8 - Practical commissioning techniques
PowerShell: because running scripts is prohibited on this system, the solution
Must know must know -c language keywords
Section 2 - branch and loop statements
Advanced C - Section 2 - pointers
[leetcode]- binary search
随机推荐
Interpretation of QT keypressevent
Shell variable learning notes
Analysis of the principle of V-model and its application in user defined components
PostgreSQL Guide: Insider exploration (Chapter 7 heap tuples and index only scanning) - Notes
Opencv image storage and reading
PowerShell: because running scripts is prohibited on this system, the solution
Avantages de win8.1 et win10
Shell built-in string substitution
2021TPAMI/图像处理:Exploiting Deep Generative Prior for Versatile Image Restoration and Manipulation
Embedded hardware - read schematic
Tita performance treasure: remote one-on-one discussion
Analysis on the similarities and differences of MVC, MVP and mvvc
Force buckle 25 A group of K flipped linked lists
SQL notes
Mind mapping series - Database
QT direction key to move focus
Chapter 18 pagination: Introduction
QT brushes and brushes
Sub paragraph of Chapter 16
Several methods of identifying equivalent circuit of circuit drawing