thebarslider
Programmer
I wish to print out a string. I have a pointer to another pointer that contains my string.
first pointer: playerptr->in
points to the in field within the structure:
typedef struct obj {
char nm[NAMEMAX];
char desc[DESCMAX];
struct obj * in;
struct obj * n;
struct obj * s;
struct obj * e;
struct obj * w;
} obj;
I can print out the nm and desc, but not in, n, s, etc....
I print out nm using:
printf("Name: %s", playerptr->nm);
But this doesnt work for in, n, etc..... as they are pointers.
I think it just prints out a memory address for these.
Please help, i'm really stuck.
Thanks.
Mark.
first pointer: playerptr->in
points to the in field within the structure:
typedef struct obj {
char nm[NAMEMAX];
char desc[DESCMAX];
struct obj * in;
struct obj * n;
struct obj * s;
struct obj * e;
struct obj * w;
} obj;
I can print out the nm and desc, but not in, n, s, etc....
I print out nm using:
printf("Name: %s", playerptr->nm);
But this doesnt work for in, n, etc..... as they are pointers.
I think it just prints out a memory address for these.
Please help, i'm really stuck.
Thanks.
Mark.