I have a problem with the creation of complex numbers in the C language. In si there is a library complex.h , but to create it I can't, visualy swears. The challenge is to create a dynamic array of complex type.
Here is the code :
In VS scanty implementation of complex numbers.
There is no implementation of type complex, and no full-fledged concept of "i".
Because of this, you can't declare and initialize a complex number as in your example (and the standard).
To initialize complex numbers you can use the macros: _FCbuild(re, im)/_CBuild(re,im)
the prefix F for float, C for double.
In itself a complex number is declared as follows: double _Val;
Other variants for float and long double.
No implementation of built-in operations (+-*/), i.e. you cannot write z1 + z2 - is a compilation error.
For multiplication function, the other operations, implement on their own.
But in the library there is a set of mathematical functions for complex argument, which is good.
In fact, you can not use offered by Microsoft type _C_float_complex (or equivalents), and to use more clear your own implementation, such as suggested by @kaela_Lind Math library functions will work with her normal (under certain conditions), just have to be types.
In General, open complex.h from the composition of the VS and study, it is quite simple.
PS: In gcc the complete implementation in accordance with the standard.
yvette57 answered on March 19th 20 at 08:38
in C89 there is no complex.h he appeared in C99. VS does not support C99. Therefore complex.h you have -- non-standard. Need to watch it to understand how to use it.
(I suspect that I have to get the double word of variable definitions).
kaela_Lind answered on March 19th 20 at 08:40
didn't even know what complex numbers are supported. Always used