+ 3
if a pointer has its data typ as integer then how can it store the memory address of a variable which may contain character?
7 Respostas
+ 3
Now I get it. What you see is still a number. You may be familiar with the common numbers that have a base of 10, called decimal numbers. What you see is a number to the base of 16, called hexadecimal number.
More practically: While for decimal numbers you would count like 0,1,2,3,4,5.6,7,8,9,10,11 and so on you count with hexadecimal numbers like 0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,10,11 and so on.
Hexadecimal numbers are often chosen to represent binary numbers as each digit of a hexadecimal number represents exactly four digits / bits in the binary format and hexadecimals are easier to read than binary numbers.
Btw, for printing to the screen a 0x is usually written before the hexadecimal number (to make them distinct from decimal numbers as 10, and other representations of a number are valid in decimal *and* hexadecimal representation (they only mean 10 and 16 respectively).
10 and 0x10 make it clearer what number representation is meant.
+ 1
suppose
int x
int *p
p=&x
output is 0eex23 which has both integer and character. how?
+ 1
No prob ;-)
+ 1
0eex23 is a address in your computer memory location of created variable
+ 1
thank you stefan
0
What do you mean? The type of a pointer is "pointer to int" (int*)?
0
got it now! thank-you genius stefan