You are right. I know you had just pointed out the general structire of the program. I just completed it for the benefit of others too. (without remove).
I have used realloc so that only needed...
Type: Posts; User: Soham
You are right. I know you had just pointed out the general structire of the program. I just completed it for the benefit of others too. (without remove).
I have used realloc so that only needed...
Thanks matsp. Very good idea.
I have made some syntax changes to your program and it works very good. Really a good idea.
#include <stdio.h>
#include <stdlib.h>
#define ADD_VAR(t, x)...
By mistake I preserved the ~ character in the file. Corrected in the following
int createfile() {
FILE *f;
char filename[256];
char filetext[2048];
The following code also works
int createfile() {
FILE *f;
char filename[256];
char filetext[2048];
I can even use the following also (Though not switch statement)
#include <stdio.h>
struct {
char opcode[5];
int ret_val;
} my_struct[] = {{"add", 1},
...
I want to execute it also. I think it is not that easy. I wanted something like Dynamic SQL from Oracle.
ANyways, thanks.
That also will work. But my original point is different. I wanted to know whether there is any other technique through which we can form a statement and execute it at runtime.
Thanks
Soham
Not really! I was thinking of this in a larger perspective. For this small scale problem, we can use if or swich statement or a program of the following kind. But I wanted to know whether there is...
Yes.
There are three integer variables x1, x2 and x3 having values 1,2 and 3 respectively. Another fourth array variable x contains either x1, x2 or x3. I want to print the value of the variable which is...
Is there any way we can form and execute a statement at runtime in C?