I need to write a function which reads two complex number from the user and stores it into the structure. How should I scan for input?
Code:typedef struct{ float real, imag; } complex_t;Code:complex_t read_complex(void) { }
I need to write a function which reads two complex number from the user and stores it into the structure. How should I scan for input?
Code:typedef struct{ float real, imag; } complex_t;Code:complex_t read_complex(void) { }
Usually, a complex number is written like a + bi.
So why not use scanf() with an appropriate format string? What have you tried?
Bye, Andreas