Edit

Share via


Compiler Error C2103

'&' on register variable

You cannot take the address of a register.

The following sample generates C2103:

// C2103.c
int main(void)
{
    register int x = 1;
    int* ptr = &x;   // C2103
}

Note

This error applies to C code.