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
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Assigning variable variable names

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Belsinga Posted - 06/15/2010 : 04:14:30 AM
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,
1   L A T E S T    R E P L I E S    (Newest First)
rlewis Posted - 06/16/2010 : 10:50:38 AM
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]);
	}

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000