LucemFerre
Programmer
I have been searching everywhere for information about how to do this, without much luck.
I establish my structure as:
struct commands
{
int xcoord;
int ycoord;
char instructions[30];
struct commands *next;
};
And there are two ways I can go. One is prompt for input three times which will be stored in three seperate variables, with which I'd like to pass to the structure and store them in the required fields.
The other is to prompt for one long string, then store the first value in the xcoord field, the second value in the ycoord field and the final values in the instructions field.
Which will be the best to use, and how would I go about writing the data to the structure as that's the part that has me stumped.
Thanks for the help.
I establish my structure as:
struct commands
{
int xcoord;
int ycoord;
char instructions[30];
struct commands *next;
};
And there are two ways I can go. One is prompt for input three times which will be stored in three seperate variables, with which I'd like to pass to the structure and store them in the required fields.
The other is to prompt for one long string, then store the first value in the xcoord field, the second value in the ycoord field and the final values in the instructions field.
Which will be the best to use, and how would I go about writing the data to the structure as that's the part that has me stumped.
Thanks for the help.