pointers c

[ad_1]

pointer in C
#include
#include
main()
{
    int *p;
    p=(int*)calloc(3*sizeof(int));
    printf("Enter first number\n");
    scanf(
    printf("Enter second number\n");
    scanf(
    printf(
    free(p);
}
pointers c
#include 
int main()
{
   int *p;
   int var = 10;

   p= &var;

   printf("Value of variable var is:
   printf("\nValue of variable var is:
   printf("\nAddress of variable var is:
   printf("\nAddress of variable var is:
   printf("\nAddress of pointer p is:
   return 0;
}
#output
#Value of variable var is: 10
#Value of variable var is: 10
#Address of variable var is: 0x7fff5ed98c4c
#Address of variable var is: 0x7fff5ed98c4c
#Address of pointer p is: 0x7fff5ed98c50

pointer in C
#include 
int main()
{
   int* pc, c;

   c = 22;
   printf("Address of c:
   printf("Value of c:

   pc = &c;
   printf("Address of pointer pc:
   printf("Content of pointer pc:

   c = 11;
   printf("Address of pointer pc:
   printf("Content of pointer pc:

   *pc = 2;
   printf("Address of c:
   printf("Value of c:
   return 0;
}
C Pointer Syntax
int* p;

[ad_2]

Please follow and like us:
Content Protection by DMCA.com