LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How Can I Define a NIComplexNumber?

0 Kudos
Message 1 of 2
(3,940 Views)

Hello Irving!

The NIComplexNumber is a typedef that is already declared in the analysis.h library of CVI. Generally speaking is a complex number consisting of a real part and an imaginary part that stores a return value for some functions, for example the PolyRootsEx function.

The definition you can find in the analysis.h file is as follows:

/* Define datatype NIComplexNumber */

#if !defined(_NIComplexNumber)

typedef struct NIComplexNumber_struct {

double real;

double imaginary;

} NIComplexNumber;

#define _NIComplexNumber

#endif

#define ComplexNum NIComplexNumber

A typedef basically lets you hide the real type of the data and use a different type to make it easier. In the previous case a complex number, which contains a real part and an imaginary part, is declared. To use this data type with no problem just include the analysis.h header file as a library to use in your source code.

For more information about typedef this link can help you:

http://en.wikipedia.org/wiki/Typedef

Have a great day!! 🙂

Oswald Branford

0 Kudos
Message 2 of 2
(3,918 Views)