Ok thanks, I have finally sorted out the issues with the \n's. I have also added a function to interpret a 'take' command, which copies the first 5 characters after the word 'take ' from the prompt...
Type: Posts; User: Joshun
Ok thanks, I have finally sorted out the issues with the \n's. I have also added a function to interpret a 'take' command, which copies the first 5 characters after the word 'take ' from the prompt...
Thanks Barney McGrew for the advice. The program now exits if there is not sufficient memory (though incredibly unlikely) and I have removed sizeof(char) since it is needed. I'm not too worried about...
Sorry rags_to_riches, you posted before I refreshed. The analyse function does require access to more than one char when more complicated command words are added later. I've managed to sort that out...
Thanks std10093, that cleared things up. Those pesky pointers, it is always hard to remember the input format especially with char pointers (which sometimes require the addressof operator). Thanks...
Thanks for the tip. I wanted to free the memory (when the program ends, just before
return 0), but it just segfaults - any idea how to resolve this? This is on a Linux-based operating system.
Code...
Hi,
I am a beginner to C, and after learning some stuff thought I'd try and write a simple adventure game. I haven't done much of it yet, only basic interaction, but am wondering how to improve the...