Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
942 B
2
Indexable
Never
#include <stdio.h>


int main()
{
   int var1 = 7;
   int var3 = 9;
   int var5 = 10;
   int var6 = 16;
   int* var2 = &var1;
   int* var4 = &var3;




   printf("%p\n",var2);
   printf("%p\n",var4);
   printf("%p\n",&var5);
   printf("%p\n",&var6);
   printf("%d\n", *var2);

   char c1 = 'c';
   char c2 = 'd';
   char c3 = 'r';
   printf("%p\n",&c1);
   printf("%p\n",&c2);
   printf("%p\n",&c3);

   printf("===========================\n");

   int i1 = 10;
   int *i2 =  &i1;
   *i2 = 12;




   printf("%d\n", i1);
   i1 = 20;
   printf("%d\n", *i2);

   printf("===========================\n");

   int arr1[] = {1,4,5,8};
   printf("%d\n", arr1[0]);
   printf("%p\n", arr1);
   printf("%d\n", *arr1);
   printf("%d\n", *(arr1+1));

   printf("%d\n", arr1+0);
   printf("%d\n", arr1+1);
   printf("%d\n", arr1+2);
   printf("%d\n", arr1+3);
   
   *(arr1+1)  <-> arr[1]
   

}
Leave a Comment