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

What is a pointer in c?

0 Answers  


What is data types?

0 Answers  


What is main function in c?

0 Answers  


Why is a semicolon (;) put at the end of every program statement?

0 Answers  


What are the different pointer models in c?

4 Answers  






write a c program to print the next of a particular no without using the arithmetic operator or looping statements?

1 Answers   TCS,


What is indirect recursion? give an example?

4 Answers  


What 'lex' does?

0 Answers   Tech Mahindra,


What does typedef struct mean?

0 Answers  


what is ram?

3 Answers   TCS,


what is the difference b/w compiler and debugger?

2 Answers   Assurgent,


How can you draw circles in C?

0 Answers   Accenture,


Categories