C++ notes 5.29

1. If p is a pointer variable: &p means the address of variable p;
*p means the value of the address pointed to by variable p;
*p+1 means adding 1 to the value pointed to by p;
*(p+1) means First move the pointer to the right by one bit and then take the value of the pointed variable.
When adding and subtracting arithmetic operations on the pointer, the number 1 represents the length of a storage unit.

2. Insert picture description here
Insert picture description here
3. C language takes function as the basic unit of the program.
4.strcat () string concatenation function, strcpy () string copy function
Insert picture description here
strcat(p1+2,p2+1); //returns the string headed by p1+2, namely "cdBCD"
strcpy(str+2, strcat(p1+2,p2+1)); //Copy "cdBCD" to the position of str+2, and overwrite the following content, at this time str is "xycdBCD"

5. Insert picture description here
6. The function fseek relocates the file position to the specified position in the file.
7. Insert picture description hereInsert picture description here
8. The file is opened using the w method, which means that the original file will be cleared and then rewritten
Insert picture description here

Guess you like

Origin blog.csdn.net/qq_43729554/article/details/106422867