Skip to main content

examples of Special Operators in c

/* 1. & --This is used to get the address of the variable.
Example : &a will give address of a.
2. *-- it  is used to get the value of the variable that the pointer is pointing to
3. Sizeof ()--This gives the size of the variable.
Example : size of (char) will give us 
*/
#include <stdio.h>
int main()
{
int *ptrq;
q = 50;
/* address of q is assigned to ptr */
ptr = &q;
/* display q's value using ptr variable */
printf("%d", *ptr);
return 0;
}
/*output
50
*/



Comments

Popular posts from this blog

example of typecasting in c

/*Type Casting in C Typecasting allows us to convert one data type into other. */ //simple example to cast int value into the float. #include <stdio.h>    int   main (){   float   f = ( float ) 9 / 4 ;     printf ( "f : %f \n " ,  f  );     return   0 ;   }