Re: Automatically generate variables
- From: Mark McIntyre <markmcintyre@xxxxxxxxxxx>
- Date: Sat, 17 Feb 2007 00:55:35 +0000
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
.
- Follow-Ups:
- Re: Automatically generate variables
- From: Yevgen Muntyan
- Re: Automatically generate variables
- References:
- Automatically generate variables
- From: Nate
- Re: Automatically generate variables
- From: Mark McIntyre
- Re: Automatically generate variables
- From: jacob navia
- Automatically generate variables
- Prev by Date: Re: function system() from stdlib.h
- Next by Date: Re: Requesting advice how to clean up C code for validating string represents integer
- Previous by thread: Re: Automatically generate variables
- Next by thread: Re: Automatically generate variables
- Index(es):