The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 vector of user-defined structs
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Keith Perkins

USA
1 Posts

Posted - 07/27/2016 :  5:46:04 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 2015, SR-2
Operating System: Win7

Is this possible? e.g.:


#include <Origin.h>
struct tag_myDevice
{
	double dRseries;
	double dRbias;
	double dRdevice;
	double dFsource;
	double dVsource;
	string strLIA;
}myDevice;

void TestFunction()
{
        vector <myDevice> vmyDevices(3);
}


The compiler error message says ":Error, Variable 'vector' not declared".

yuki_wu

896 Posts

Posted - 07/27/2016 :  10:20:35 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Keith,

I think you can try Array class in this case.

#include <Origin.h>
#include <Array.h>
struct tag_myDevice
{
	double dRseries;
	double dRbias;
	double dRdevice;
	double dFsource;
	double dVsource;
	string strLIA;
};

void TestFunction()
{
        Array<tag_myDevice&> vmyDevices;
}

Hope it helps.

Yuki
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000