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
 Assigning variable variable names
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Belsinga

Netherlands
28 Posts

Posted - 06/15/2010 :  04:14:30 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 8 SR 6
Operating System: Win XP

Hello,

Is it possible to assign variable names to variables? E.g. when I want multiple integers that I want to name int1, int2 etc. in a loop-like structure:

something like:
for(int n =1; n< 10; n++)
{
int int( -?- n) = n; // is there a way to do this?
}

which would yield int1 = 1; int2 = 2 and so on

Regards,

rlewis

Canada
253 Posts

Posted - 06/16/2010 :  10:50:38 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Try something like ...

	vector<int> MyVars;
	MyVars.RemoveAll();
	for(int i=0;i<15;i++)
	{
		MyVars.Add(i);
	}
	for(i=0;i<MyVars.GetSize();i++)
	{
		out_int("Int Value = ",MyVars[i]);
	}
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