Hi.
Can anyone tell me why the following code produces garbled output? Garbled as in enter 2 as an argument and get 251500661 back. Run the program again with same argument and the number changes. I have been reading and reading and trying and trying and afaik this should be how it is supposed to work. string arguments are passed along nicely, btw, just not integers. I am using gcc.
/* Testing readargs. */
#include
#include
#define TEMPLATE "D=DeviceNameLength/K/N"
LONG arguments[1];
struct RDArgs *rda = NULL;
int main(void) {
if(rda = ReadArgs(TEMPLATE, arguments, NULL)) {
if(arguments[0])
printf("Device name length chosen: %d\n", (LONG *)arguments[0]);
FreeArgs(rda);
}
else {
printf("Wrong arguments. Use argument '?' to see correct usage.\n");
return 0;
}
return 1;
}
Sincerely,
-Kenneth Straarup.
PS: solutions in laymans terms, please 
edit: hm, so spaces aren't very visible, it seems. Or they just didn't get pasted properly. I hope you can make it out, still.