Question: What is difference between 

```
int x=7;

```

and 

```
register int x=7;

```

?

I am using C++.

Answer: 
In C++ as it existed in 2010, any program which is valid that uses the keywords "auto" or "register" will be semantically identical to one with those keywords removed (unless they appear in stringized macros or other similar contexts). In that sense the keywords are useless for properly-compiling programs. On the other hand, the keywords might be useful in certain macro contexts to ensure that improper usage of a macro will cause a compile-time error rather than producing bogus code.

In C++11 and later versions of the language, the `auto` keyword was re-purposed to act as a pseudo-type for objects which are initialized, which a compiler will automatically replace with the type of the initializing expression. Thus, in C++03, the declaration: `auto int i=(unsigned char)5;` was equivalent to `int i=5;` when used within a block context, and `auto i=(unsigned char)5;` was a constraint violation. In C++11, `auto int i=(unsigned char)5;` became a constraint violation while `auto i=(unsigned char)5;` became equivalent to `auto unsigned char i=5;`.
The `register` keyword was useful for:

* Inline assembly.
* Expert C/C++ programming.
* Cacheable variables declaration.

An example of a productive system, where the `register` keyword was required:

```
typedef unsigned long long Out;
volatile Out out,tmp;
Out register rax asm("rax");
asm volatile("rdtsc":"=A"(rax));
out=out*tmp+rax;

```

It has been deprecated since C++11 and is unused and reserved in [C++17](http://en.cppreference.com/w/cpp/keyword/register).