Compiler output
prog.cpp:5:27: error: 'int index' redeclared as different kind of symbol
int number, totalNumbers, index, finalNumber;
^
In file included from /usr/include/c++/4.9/cstring:42:0,
from /usr/include/arm-linux-gnueabihf/c++/4.9/bits/stdc++.h:48,
from prog.cpp:1:
/usr/include/string.h:482:1: note: previous declaration 'const char* index(const char*, int)'
index (const char *__s, int __c) __THROW
^
prog.cpp: In function 'int main()':
prog.cpp:13:21: error: overloaded function with no contextual type information
for ( index = 1; index <= number; index <<= 1 );
^
prog.cpp:13:35: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator<='
for ( index = 1; index <= number; index <<= 1 );
^
prog.cpp:13:49: error: overloaded function with no contextual type information
for ( index = 1; index <= number; index <<= 1 );
^
prog.cpp:14:15: error: overloaded function with no contextual type information
index >>= 1;
^
prog.cpp:15:21: error: cannot resolve overloaded function 'index' based on conversion to type 'int'
finalNumber = index;
^
prog.cpp:16:23: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator!='
if ( index != number )
^
prog.cpp:17:39: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator>>'
finalNumber += (index >> 1);
^