OO C++ - Virtual Methods
Posted
by
Phorce
on Stack Overflow
See other posts from Stack Overflow
or by Phorce
Published on 2012-09-10T09:32:46Z
Indexed on
2012/09/10
9:38 UTC
Read the original article
Hit count: 196
Just a really quick question here. I'm using virtual functions to read in from a text file. Now, it's virtual because in one aspect I want the values to be normalised, and, in the other respect I don't want them to be normalised. I have tried to do this:
bool readwav(string theFile, 'native');
So in theory, if the 'native' is used, this method should be called, however, if 'double' is called then a different version of the method is called. Same for if the value is empty, it should just perform the native option.
First question, why doesn't the declaration above work? Also, is this the best route to go down? Or, would it be better to have just one class method that switches between the options.
Thanks :)
© Stack Overflow or respective owner