I am trying to implement a simple function that reads a matrix from a file.
I can't understand why the instructions:
for ( int current = 0; current < COLS * ROWS; current++ ) ifile >> *( first_el + current );
don't work if first_el is a constant pointer to a constant integer (const int * const ).
GCC doesn't compile and here is the log
error: ambiguous overload for 'operator>>' in 'ifile >> *(((const int*)first_el) + ((unsigned int)(((unsigned int)current) * 4u)))'
They work if first_el is a ( variable )pointer to a constant integer ( const int * )
This post has been edited by domenico: 17 February 2013 - 04:44 AM