Discussion Forums

New User? Please read instructions!

Pointers  

  RSS

zuherabud
New Member
Joined: 4 months  ago
Posts: 1
26/05/2017 2:36 am  

#include <stdio.h>

int main(){

   int* pc;

   int c;

   c=22;

   printf("Address of c:%u\n",&c);

   printf("Value of c:%d\n\n",c);

   pc=&c;  //pc=6356744

   printf("Value of pointer pc:%u\n",pc);

   printf("Address of pointer pc:%u\n",&pc);

   printf("Content of pointer pc:%d\n\n",*pc);

   c=11;

   printf("Value of pointer pc:%u\n",pc);

   printf("Address of pointer pc:%u\n",&pc);

   printf("Content of pointer pc:%d\n\n",*pc);

   *pc=2;

   printf("Address of c:%u\n",&c);

   printf("Value of c:%d\n\n",c);

   return 0;

}

can anyone please explain the difference between address pointer and content??


ReplyQuote
manyou
New Member
Joined: 3 months  ago
Posts: 2
28/06/2017 2:20 am  

pointer is a variable whose value is the address of another variable, i.e., direct address of the memory location. Like any variable or constant, you must declare a pointer before using it to store any variable address

 

Regards

Christian

https://www.clouddesktoponline.com/


manyou liked
ReplyQuote
  
Working

Please Login or Register

1. Online Compilers - Compile & Run your C/C++ programs:

✅ Online Compilers

2. Ask your questions or clarify your/others doubts from,

✅ Online Discussion Forums by Fresh2Refresh.com





Share this website !!!
Facebook Twitter Linkedin

Close
We Support JALLIKATTU !!!
We Support JALLIKATTU!
By Fresh2Refresh.com
Show Your Support as well. Thanks!