B
Bala L
I have a class with a private array data member 'm_array'. I have
written a public function, called 'fileRead', to read values into the
array from a file. I just noticed that I have declared this function to
be const.
I dont understand how the code compiled and executed without returning
an error or a warning. I am assigning values from a file to m_array
inside this function. I thought that a member function can be made
const only if *this (this pointer) is not being modified. Am I missing
something?
Btw, I am using the Visual C++ .NET environment to run the code.
written a public function, called 'fileRead', to read values into the
array from a file. I just noticed that I have declared this function to
be const.
I dont understand how the code compiled and executed without returning
an error or a warning. I am assigning values from a file to m_array
inside this function. I thought that a member function can be made
const only if *this (this pointer) is not being modified. Am I missing
something?
Btw, I am using the Visual C++ .NET environment to run the code.