dear c++ experts:(I am using g++4.6.1)
when my input expect a double, can I use fraction number that can be auto calculated to be a double? I tried but it is not work.
I try to
cin << a
where a is complex<double>
at runtime from terminal, I input (0, -1/4.84)
but the output of a show its imaginary part is 0 , instead as -2.066
like to find someway to make this auto transform from fraction input be accptable
and recognizable to double in the corresponding variable.
thanks your help a lot in advance, Eric
The short answer is No, you cannot. Want to support the feature? You need to receive the input as a string, then examine the contents of the string and determine if what you have is a fraction or a number.