Re: Automatically generate variables



On Wed, 14 Feb 2007 00:25:45 +0100, in comp.lang.c , jacob navia
<jacob@xxxxxxxxxxxxxxxx> wrote:

Mark McIntyre wrote:
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.



Wrong

Right.

#include <stdio.h>
#include <windows.h>

Beep beep. This isn't C.

void *h = LoadLibrary("variables.dll");
fn = (void (*fn)(int))GetProcAddress("GetDynamicObject");

This isn't either.

But then you knew this, you just wanted to disagree with me I suspect.
--
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
.