Right Click to Search

Friday, January 1, 2025

Address Operator in C Programming



  1. It is Denoted by '&'
  2. When used as a prefix to a variable name '&' operator gives the address of that variable.
Example :


&n
Gives address on n


No
Invalid Use of Address Operator

1
&75
2
&(a+b)
3
&('a')

// How Address Operator works ?
#include
void main()
{
int a = 10;
printf("\n Value of  n is : %d ",n);
printf("\n Value of &n is : %u ",&n);
}

Output :

Value of  n is : 10
Value of &n is : 1002

Bookmark & Share

Tags / Keywords : |

Stumble
Delicious
Technorati
Twitter
Facebook

2 Comments:

Kevin Rodrigues said...

It would be nice if you could post an example of using pointers in C. This would explain the use of this operator in a better way.

Code-Guru said...

Thanks Kevin Rodrigues , I will Post Examples to digest pointer concept easily

Post a Comment

Your Feedback :This is Growing Site and Your Feedback is important for Us to improve the Site performance & Quality of Content.Feel Free to contact and Please Provide Name & Contact Email

 

Learn C Programming Copyright © 2010 LKart Theme is Designed by Lasantha, Free Blogger Templates