Thread: game code help
View Single Post
Mar 23rd, 2004
0

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
C++ Syntax (Toggle Plain Text)
  1. (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.
C++ Syntax (Toggle Plain Text)
  1. std::cout << ...
or put a
C++ Syntax (Toggle Plain Text)
  1. 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.
Reputation Points: 12
Solved Threads: 2
Newbie Poster
Steu is offline Offline
11 posts
since Mar 2004