Re: Automatically generate variables
- From: Mark McIntyre <markmcintyre@xxxxxxxxxxx>
- Date: Tue, 13 Feb 2007 22:55:34 +0000
On 13 Feb 2007 08:35:59 -0800, in comp.lang.c , "Nate"
<nverbeek@xxxxxxxxxxxxx> wrote:
Hello,
I am looking for a method to automatically declare variables in C.
I'm not sure if there is a good way to do this,
There isn't - you can't define object names at runtime in C.
You could mallocate an array of objects however, and size it to
whatever size you needed. This is likely to be more useful anyway as
the chances are you will need to loop over the variables.
--
Mark McIntyre
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
.
- Follow-Ups:
- Re: Automatically generate variables
- From: jacob navia
- Re: Automatically generate variables
- References:
- Automatically generate variables
- From: Nate
- Automatically generate variables
- Prev by Date: Re: How to avoid stack overflow in C????
- Next by Date: Re: Self copying code
- Previous by thread: Re: Automatically generate variables
- Next by thread: Re: Automatically generate variables
- Index(es):
Relevant Pages
|