[Main]
Title=Can I use # (indirection) like in TI-Basic?

[Top]
<TABLE CELLPADDING="4"><TR><TD VALIGN="TOP"><B>Q:</B></TD><TD>
I wonder how I can simulate the indirection operator (<CODE>'#'</CODE>) from
TI-Basic in C programs...
</TD></TR><TR><TD VALIGN="TOP"><B>A:</B></TD><TD>
Nothing equivalent to indirection (<CODE>'#'</CODE>) exists in any compiling
language (like C), since the variable names do not appear in the compiled
program. You need to make up your mind to avoid this operator.
For indirect references to variables in C, you can use
<A HREF="$$INFOLINK(opers/asterisk)">pointers</A>. However, usually you can
re-express the code using multiple
<CODE><A HREF="$$INFOLINK(keywords/if)">if</A></CODE>-<CODE><A HREF="$$INFOLINK(keywords/else)">else</A></CODE>
statements or arrays. Don't be afraid, C will process it 1000 times faster
than TI-Basic processes indirections.
</TD></TR></TABLE>
