How is square expressed in C language?
Just multiply two numbers (or variables) directly, such as x*x
In addition In C language, the math.h file contains a library function for exponentiation (including square root), which is pow(x,y)
where x and y are both double precision floating point (double) types, x is the base, y is the exponent (if it is a decimal, it is the square root) How is "or" expressed in C language?
In C language, the symbol for the OR operation is ||
< p> For example: a>0||b>0means a is greater than 0, or b is greater than 0
char str1[] = "HelloWorld "; Define the string "HelloWorld" through a character array, each storage unit in the array stores one character
char *str2 = "HelloWorld"; Define the string "HelloWorld" through a character pointer, pointer str2 Points to the first address of a continuous address unit that stores the string "HelloWorld"
#define str3 "HelloWorld"; Define the string "HelloWorld" through macro definition, which is equivalent to str3="HelloWorld" C language How is the base represented?
Decimal
a = 99;
Hexadecimal
a = 0x99;< /p>
Octal
a = 0143;
Binary
No, generally use hexadecimal instead, count from the end, 4-digit conversion into 1 digit in hexadecimal
0110 0011
6 3
a = 0x63; C language newbies need to do their homework urgently! *adr and *adr in C language What does *str represent?
*adr and *str are the function parameters for copying strings you mentioned. In fact, they are just the names of the parameters. There is nothing special. It is just that the system function is written like this, so you can just use it
< p> Check that the first character cannot be 0, and the following characters can only be between '0' and '9'. You can write how to express division in C language yourself1 Division in C language Represented by the symbol / (forward slash)
2 Usage
(1) When the dividend and divisor are both integer types, the result is an integer type
For example The result of 1/2 is 0, and the result of 9/2 is 4
(2) When either the dividend and the divisor are floating point numbers, the result is a floating point number
For example, 1.0/ The result of 2 is 0.5000000000000000 (double type), the result of 9.0/2.0 is 4.5000000000000000 (double type);
The result of 1.0F/2 is 0.500000000 (float type), and the result of 9/2.0F is 4.50000000 (float type)
3 extensions
Floating-point numbers include single-precision floating-point numbers (float) and double-precision floating-point numbers (double). What is represented by pointers in static linked lists in the C language
p>How to express the space in A memory address in C language?
If you print directly, just enter a space directly
Or use ASCII code 20 to express it