I've made it compile with the test file, and it gave me this
You wake up.
you are in room #0
There is an exit to the east.
there seems to be a white space on the output, i'm gonna do a printf on the room_idx, brb
I've made it compile with the test file, and it gave me this
You wake up.
you are in room #0
There is an exit to the east.
there seems to be a white space on the output, i'm gonna do a printf on the room_idx, brb
A typical example of ...cheap programming practices.Code:... goto johny_walker_red_label; johny_walker_blue_label: exit(-149$); johny_walker_red_label : exit( -22$);
i checked, the range, it was from 0-25 which is num_rooms-1, i'll have to check the other files, maybe it's doing an error there
ah xuftugulus u are awesome! what does strdup(c) do?
u see i've actually had it right the first night i wrote the code (day 1), but i didn't know about the -> when its in nested pointers, so i did it with **,and since i had a programming problem midway i thought i was completely wrong and scrapped it =\
thanks^(n!)
oh, and also, "0" zero is actually '\0' and i dont have to use the \'s? is that right?
i'll be starting on the next part, can i ask u further questions when i get stuck?
Last edited by NoobieGecko; 02-17-2008 at 02:04 AM.
Sure in the meantime i made the go() function and will be playing game. :P
Declared as:
char *strdup(char *s);
It allocates the memory copies the string and returns you the pointer to the copy.
Just remeber the memory must freed by you then, so that pointer must not be used in pointer arithmetic, or free() will make the program crash.
0 and '\0' are usually the same value. I don't know of any encoding where the character '\0' doesn't evaluate to 0, and so since a single character is an integral value you can assign a plain 0 to it, although i usually assign a '\0' to remind me that it is a character.
Sorry for the confusion on this, but i just wrote the code fast and a little careless...
Last edited by xuftugulus; 02-17-2008 at 02:16 AM.
A typical example of ...cheap programming practices.Code:... goto johny_walker_red_label; johny_walker_blue_label: exit(-149$); johny_walker_red_label : exit( -22$);
i'm just about reading the spec -_-
A typical example of ...cheap programming practices.Code:... goto johny_walker_red_label; johny_walker_blue_label: exit(-149$); johny_walker_red_label : exit( -22$);
hah, i didn't get the joke just kidding
NoobieGecko, i know it's been a while since this post was touched, but are you still around? can you PM me?
This counts as bumping a thread, since posting in any thread older than 2 weeks old counts as bumping.If you want to contact the OP, PM them yourself.
I don't think you'll have any luck, though, since NoobieGecko's profile page says this:
If you have a similar question, consider starting a new thread but linking to this old one. As it is, that's probably what will end up happening anyway since a moderator will likely split this one.# Last Activity: 10-12-2008 02:43 AM
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
Right. Didn't think of that. Yes, it's because you have less than a certain threshold of posts. I'm not sure exactly what the number is.
Seriously, though. You're not going to get a response from NoobieGecko. If you have a question, post it.
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.