0

i would like to pass the integer value in the module. following is my C code;

 int i;
 SYMBOL di;
 di   = symbol_CreateStandardVariable();

and the module is

 t = term_Create(Door,list_Cons(term_Create(di, list_Nil()), list_List(term_Create(di, list_Nil()))));

is there any way so that i can pass the value like d1, d2 , d3 ... iteratively and pass in the module in place of di?

Thanks in advance.

2
  • What is this code intended to do? Commented Nov 11, 2010 at 20:19
  • At the end of the day, this program gets new standard variable for every new input symbol. So as to make the symbol different,i need to pass different symbols. thus for passing differnet variable i thought of changing the numerical value by iterations. Commented Nov 11, 2010 at 20:33

1 Answer 1

3

If I understand your question correctly, you are asking how to iterate the variables d1, d2, d3 in sequence, based on the name of the variable and the value of i.

So, while you cannot do that directly, it sounds like what you are looking for is a for loop that loops over an array.

Sign up to request clarification or add additional context in comments.

1 Comment

i mean i want to replace the di with iterations by d1,d2 and so on. yes that is loop over array. I didn't get perfect idea for it too,may be due to lack of strong command over C. can you please help me out?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.