So I was just think of how to do it and gave it a go. Heres what I got, It works fine, I just want to know if there would be a better way of doing it, a more efficient way so there isn't as many if...
Type: Posts; User: Slynet
So I was just think of how to do it and gave it a go. Heres what I got, It works fine, I just want to know if there would be a better way of doing it, a more efficient way so there isn't as many if...
Ok, I get it, thanks. It's really annoying that this book doesn't include them two headers, if you're going to teach someone, teach them properly.
In the post with the errors, that included the headers stdlib.h and time.h, which was advised.
In the post after I stated "it is now compiling", as opposed to before. In the successful compilation...
Ok, so I've never used this function before and this is the example in the book. But if if use:
srand(time(0))
It works fine. Can someone explain to me what exactly it's doing, please.
...
Ha, I'll take your sarcasm as humor for now. :)
Sorry, it's quite late here, bit brain dead. :P
So, when I compile it comes up with the errors:
C:\Documents and Settings\User\Desktop\1.c...
It didn't say to include stdlib.h and time.h for one, even with them included it still does not compile.
I can't see why this wouldn't work. Either I'm completely missing something or this book is missing something.
#include <stdio.h>
#include <windows.h>
main()
{
int iRandom =...