Type of the register variable

What type of variable is declared with the keyword register?

I met this code. What is the type of the n variable here?

int main() {
    register n;
}
Author: riot, 2020-07-14

1 answers

Register is an object memory class in C, meaning that a number is moved to a register. It seems that this makes operations with him go faster.

Also, as avp correctly noted:

register always been a hint (hint, advice). The compiler is not obliged to put such a variable in a register, but it is entitled to listen to such advice, at least during optimization, such a variable will have a higher priority for placing in a register than others. / And yet, at least in the old C, the int type it existed by default (at least as the type of the value returned by the function), so it could not be specified together with the hint

In general, the default type here is int, as if you wrote, for example, signed var

But I think that there is no point in using this. I saw a mention of this type only in the book about si 91go year....

 -2
Author: Trifonov Dmitriy, 2020-07-14 16:04:13