Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Read double written with d character

Read double written with d character

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 439 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    laetis
    wrote on last edited by
    #1

    Hi,

    I want to read a double value from a file. This value was generated by Fortran thus it uses the "d convention", 0.001 is written 1.d-3., when I tried to read it, it gives 1....

    Here the code
    In main:
    @double tempdouble;
    read_real("Ffile",&tempdouble);
    cout<<tempdouble<<endl;@

    The function:
    @void read_real(QString name, double *value)
    {
    ifstream file(qPrintable(name));
    double Value;
    file >> Value;
    file.close();
    *value=Value;

    }@

    Thanks

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved