Re: Automatically generate variables



Yevgen Muntyan wrote:
Mark McIntyre wrote:
jacob navia wrote:
Mark McIntyre wrote:

<snip>

There isn't - you can't define object names at runtime in C.

Wrong

#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.

Nonsense. It is C. It's not strictly conforming, it won't work
almost anywhere, it's rather useless, it's off-topic here, all this
was in details explained in another reply to JN post. But it is C,
where "C" means "C language as defined by the ISO standard".

But the ISO standard doesn't define the windows.h header or the
functions LoadLibrary or GetProcAddress. It uses the syntax and
semantics as defined in the standard, but uses various extensions not
defined in the standard. If one or more of these extensions change the
standard syntax and semantics of C, then it's debatable if the
resulting code can even be called as C. That's why GNU C is called as
GNU C and not C.

.



Relevant Pages