On 2/19/16 11:15 PM, Lisa wrote:
module main;

import std.stdio;
import std.math;

int main() {
     int A, B, C;

     writef("A = ");
     readf("%lf", %A);

You want &A, not %A.

Also, note that you declared A, B, C as integers, but are using %lf which is for doubles. However, readf is much smarter than scanf. You can just use %s as format specifier, and it will figure out what should happen based on the given type.

-Steve
        • Re: 111 Lisa via Digitalmars-d-learn
          • Re: 111 Chris Wright via Digitalmars-d-learn
            • Re: 111 Adam D. Ruppe via Digitalmars-d-learn
      • Re: 111 cym13 via Digitalmars-d-learn
  • Re: 111 Ivan Kazmenko via Digitalmars-d-learn
  • Re: 111 Ali Çehreli via Digitalmars-d-learn
    • Re: 111 Lisa via Digitalmars-d-learn
    • Re: 111 Lisa via Digitalmars-d-learn
      • Re: 111 Ali Çehreli via Digitalmars-d-learn
        • Re: 111 Lisa via Digitalmars-d-learn
          • Re: 111 Steven Schveighoffer via Digitalmars-d-learn
          • Re: 111 Ivan Kazmenko via Digitalmars-d-learn
            • Re: 111 Lisa via Digitalmars-d-learn
              • Re:... Ivan Kazmenko via Digitalmars-d-learn
              • Re:... Lisa via Digitalmars-d-learn
  • Re: 111 Lisa via Digitalmars-d-learn

Reply via email to