Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I do the CNiReal64Vector as a global variable?

My problem is with the CNiReal64Vector. Ive tried to define this vector as a global variable in the header file:

public

:

NI::CNiReal64Vector plotData(50);

but the debuger flushed error : Syntax error ´constant´.

Of course,  I used usually square brackets:

 public:

double plotData[50];

Is it possible define the array of CNiReal64Vector as a global variable?

Thank You.

Best Regards

Emta

 

 
0 Kudos
Message 1 of 3
(3,437 Views)
In the header (.h) file, declare the variable like this:
extern NI::CNiReal64Vector plotData;
 
In a source (.cpp) file, define the variable like this:
NI::CNiReal64Vector plotData(50);
 

This will cause the compiler to generate a single instance of the plotData global variable and a call to the CNiReal64Vector constructor that takes an integer that specifies the initial size. I believe that this is what you are trying to do.
0 Kudos
Message 2 of 3
(3,434 Views)
Thank You very much. Im working with Measurement Studio for a short time. emta
0 Kudos
Message 3 of 3
(3,431 Views)