Question: I am a bit confused by the key word "register" in C.
It seems to tell the compiler that it should be stored in a register which means that some of my variables are stored in Registers and some in memory? If so, is there a way to find out whether my value is stored in a register or in Memory?

For example:

```
int *x =  (int*) 0x1234;

```

X does not seem to point on a register now, because such addresses are for memory.
But I have tried several times to find a different looking address (also using "register" key word). Even on the internet nobody seems to care.

So my main question: How does the address in a pointer look when it points on a register?

EDIT: I can't find an answer to my main question at the end of my question in the other question. My question is NOT about the key word "register", I just mentioned it.

Answer: 
> 
> How does the address in a pointer look when it points on a register?
> 
> 
> 

Pointers are a concept of memory, registers do not have addresses. Every processor has a limited, fixed amount of registers (8 - 16 probably). 

As others have mentioned, the `register` is not really useful anymore and even sometimes ignored by compilers. 

To understand what registers really are, consider this example:

```
int a = k / 53;  // k is an int defined somewhere else...
int b = a * 9;
// a is not used after the above line

```

Now, we have not declared `a` with `register` but any reasonable compiler will still keep a in a register.

The reason for this is that to perform any operation the operands have to be in certain registers. The the result of the operation will then e.g. be stored in the register of the first operand.

In order to compute `a` from the above example, the compiler will write code to load `k` (which presumably is in memory) into a certain register (let's call it register A) and 53 into another. After the computation is done, register A will contain the result of the operation. Since we are going to multiple that result by nine in the next line anyway, we can just keep it were it is, load 9 into the other register and multiply. Storing the value into memory and then loading it back into a register would just waste a lot of time.

Note that declaring `a` with `volatile` would prevent optimizations like this and force the compiler to actually store and load `a`. (Although `volatile` does not make any sense with this example here at all, and is hardly ever useful if you do not, for instance, interface special kind of hardware.)
In modern compilers, an object you declare in C does not necessarily have a single location in which it exists. To optimize your program, the compiler may keep it in a register at some times, on the stack at others, or in a particular memory location at others. Normally, you do not need to know which.

When you take the address of the object and work with pointers, the compiler makes your program work as if the object did have a fixed address. Often this is done by putting the object in an assigned memory location, at least for the duration of time that you are using its address, but the compiler is allowed to achieve the end results of your program by other means.

If you declare an object with `register`, you are not supposed to, by the C standard, take its address. However, some compilers may permit this.