hello everybody
can we change a the adress of a variabl i mean can i put for
exemple for a int *p:
&p=6
?????????



hello everybody can we change a the adress of a variabl i mean can i put for exemple for a int *p..

Answer / letskools

No,We cannot change the address of memory of a variable
because the addresses to the variable are provided by the
OS. We can only assign this address to the pointer variable
like this:
int x,*p;
P=&x;
We can change variable value through pointer like this:
*p=4;
but we can't change the variable address through the pointer
and also we can't provide any address to the pointer
variable directly as an "numeric constant" so this statement
is incorrect:
&p=6;

Is This Answer Correct ?    6 Yes 0 No

Post New Answer

More C Interview Questions

while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above

1 Answers  


What is pointers in c with example?

0 Answers  


what is the difference between normal variables and pointer variables..............

15 Answers   HP, Infosys, Satyam, Vivekanand Education Society,


What are preprocessor directives?

1 Answers  


How do you determine a file’s attributes?

1 Answers  


What is the difference b/w Structure & Class?

3 Answers  


What is the difference between null pointer and wild pointer?

1 Answers  


write a program to find the given number is prime or not

3 Answers   Accenture, Vasutech,


what is default constructor?

2 Answers   HCL,


cavium networks written test pattern ..

1 Answers   Cavium Networks,


How to removing white spces in c programming only bu using loops

2 Answers  


What is the equivalent code of the following statement in WHILE LOOP format?

1 Answers  


Categories