tags:

views:

59

answers:

2
void add(int register, int& acc)
{
    acc += register;
}

main.cpp:124: error: expected primary-expression before ‘register’

wth is wrong right there?

+8  A: 

"register" is a keyword in C++ (a hangover from C days, mostly)

Paul
thx dude, i really went crazy
co-worker
+3  A: 

register is a C++ keyword, rename this to something else. It's used to qualify variables as a hint to the compiler to optimize the variable's storage directly to a CPU register rather than RAM - see here.

Steve Townsend