![]() |
| ||
| game code help i found this off some site and when i build it in vis c++, the errors are with the two random functions. will someone tell me why and how i can fix this. the random on line 15 and randomize on line 36. undeclared identifiers. /* Jason Cordes */ |
| ||
| Re: game code help Just a few things about this code, whoever wrote doesn't really understand completely what is going on. The header fstream is for file i/o, which isn't used in this program at all, also cout, and cin are used so the iostream header must be included. For the random functions I think what is needed is randomize = srand (seed the random number generator) and random(die) can be reproduced from (rand() % die) + 1 Also some compilers don't care about this, but some do, cout, and cin are contained in the namespace std, so you may need to fully qualify them i.e. std::cout << ...or put a using namespace std;at the top of your program. Doing this, I still could not get it to compile because VS.net 2003 gives a fatal compile error. |
| ||
| Re: game code help As the author of the code, I would offer in my own self defense that this code was written in 1994 before C++ was ansi compliant. if anyone has questions about this code, 1. delete it and ask me what you really want to do and I'll give you something much cleaner to look at. |
| All times are GMT -4. The time now is 8:26 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC