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

write the program for maximum of the following numbers? 122,198,290,71,143,325,98

5 Answers  


Difference between malloc() and calloc() function?

0 Answers  


Differentiate between calloc and malloc.

0 Answers   Wipro,


Can you add pointers together? Why would you?

0 Answers  


Why is it that not all header files are declared in every C program?

0 Answers  






What are the different types of data structures in c?

0 Answers  


Write a code to generate divisors of an integer?

0 Answers   Ericsson,


character array A[12] can hold

5 Answers   Wipro,


how many times of error occur in C

11 Answers  


`write a program to display the recomended action depends on a color of trafic light using nested if statments

0 Answers  


Consider a language that does not have arrays but does have stacks as a data type.and PUSH POP..are all defined .Show how a one dimensional array can be implemented by using two stacks.

3 Answers   Google,


Is there sort function in c?

0 Answers  


Categories