w3ajay

tally tutorial point, ms word 2013, ms excel 2013, ms powerpoint 2010,ccc question with answer in hindi 2021, Tally Prime in hindi , tally prime,Python,in python,programming in python,python

Wednesday, January 8, 2020

Simple Program for Print address of Variable Using Pointer in C, C Pointers (With Examples)

Simple Program for Print address of Variable Using Pointer in C


Pointers (pointer variables) are special variables that are used to store addresses rather than values.
To print the address of a variable we use %p

#include <stdio.h>
#include<conio.h>
void main()
{
   int num = 10;
   printf("Value of variable num is: %d", num);
   /* To print the address of a variable we use %p
    * format specifier and ampersand (&) sign just
    * before the variable name like &num.
    */
   printf("\nAddress of variable num is: %p", &num);
   getch();
}

Pointers in C Programming with examples

No comments:

Post a Comment

for more information please share like comment and subscribe