Hi there. I have a 2d array of structures and i am having trouble getting at them. I'm still relatviley new and pointers are *not* my forté.
I've sent the whole code below, cause i really dont know what's going on.
Its supposed to be a mars rover simulation, now I'm really nowhere near completion, but I'm working on the "move" command. I need to have some sort of pointer pointing to a position in trhe array, and then move it either up down left right etc within the array. i was thinking of maybe using th gridx and gridy ints within the structure. How do i set up a pointer to the 2d array of structures? I currently am making the map within a function (and as such, probably have to pass a pointer to it as an argument)
Desperate cry, i'm really not having fun with this. in the make map function, do i have to return the pointer? ok let me rephrase that. How do i return a pointer from a function? or do i just set the pointer up within the function and then be able to access it outside the program?
Maybe a look at my code below might help.?
*desperate face*
I'm hoping getting one function right will get me set up for the rest
Cheers for _any_ input you may have
ta,
Mitch