int * p;
p = a; No, you can only give the address to P.
p = & ampa; P points to a
p =(int *)a; Forcibly convert a into p's address.
In c language, how to assign the address of long int variable to char variable? You mean to assign the address of the long int variable to the char variable pointer?
If so:
char * PCH =(char *)& amp; Long-int-var will do.
If you assign an address to a char variable, it is impossible, because a char usually has only one byte, while an address usually has four bytes.
I hope I can help you. If you have any questions, please leave a message.
The problem of assigning a value to a variable of type int by shifting a variable of type char to the left by 8 bits needs to be moved to int first, and then to the left.
take for example
char c = 0x 12;
int a =(int)c & lt; & lt8;
-32 100 can be assigned to int long int variable? Int type 32-bit integer
Long 64-bit integer
Long can accept numbers as long as variables of type int can accept numbers.
How to assign the value of int variable to char* variable When the value of A you define is not greater than 127, it is ok to do it upstairs, but if it exceeds 127, an error will occur. Because integers are used to define character variables, and the characters corresponding to integers are represented in ASCII code, but there is only 127 in ASCII code, so when the defined integer exceeds 127, the definition is meaningless, and the subsequent operations will be wrong!
Let x be a floating-point variable and y be an int variable, then y = (int) x; Is the correct assignment statement pair
Is the number of bytes of int variable fixed? Has nothing to do with the assignment of int variables? (32-bit system) The amount of memory space allocated to int variables by the system is related to the system. It used to be 2 bytes, but now it is mostly 4 bytes.
It should be pointed out that the number of bytes allocated by int variables is only related to the system, and has nothing to do with the assignment size or even whether it is assigned.
What is the type of int**? INT * is the pointer type, pointing to "&; Variable ",then what is the type of int**, pointing to"&; Pointer variable "? Int* is the pointer type of integer, int** is the pointer type of integer pointer, and variables of type int* can be assigned as the address of variables. Variable, then a type of variable in * * can be assigned as the address of an integer pointer variable, that is&; Integer pointer variable.
So your understanding is basically correct.
Can C directly assign char to integer variables? Yes, the value of integer variable is the decimal value of character variable in ASCII table.
K is an int variable in C language. What is the value of (++k)+(++k)? int k = 1 1; k = 1 1 k++; k = 12 int I = k++; I = 12k = 13 I = ++ k; Before I = 14 k = 14 ++ variable, add before operation; ++variable, first operation, then self-increment.