I was doing a bit of review on pointers in C and I was a bit confused by a bit of code I came across. I was doing a quiz on `qeeksquiz.com/pointers` to review, and I came across this piece of code:

```
#include<stdio.h> 
int main() 
{ 
   int a; 
   char *x; 
   x = (char *) &a; 
   a = 512; 
   x[0] = 1; 
   x[1] = 2; 
   printf("%d\n",a);   
   return 0; 
}

```

When I came across `x = (char *) &a` I got a bit confused. I understand that x is a pointer that holds the address of a, but when we assign `x[0] = 1` and `x[1] = 2;` the answer, when printed, is 513. The answer talks about how it depends on what machine we are using, and how the little-endian machine changes how it reads a in binary. I am thoroughly confused on how we get from 512 to 513. I'm guessing it is because x[0] = 1 but I am not 100% sure. Can someone help explain this? If we assigned `x[0] = 2`, what would the value of a change to?

Thanks for the help!