Return the complete number

a11e99z black80 at bk.ru
Wed Jul 24 15:56:13 UTC 2019


On Wednesday, 24 July 2019 at 15:45:08 UTC, Greatsam4sure wrote:
> int main(){
>  double mum = 0;
>  Write("enter a number: ")
>  readf(" %s\n",&num);
>  Writeln(num);
>
> }
>
> How do I return the complete number the user enter since I 
> don't since the user can enter numbers of various length with 
> dmd approximating it.
>
> I will appreciate any help

   readf!" %s\n"( num );
or
   num.readf!" %s\n";
or
   num = readln.strip.to!double;


More information about the Digitalmars-d-learn mailing list