Ok. I am writing a program that tells your fortune.
What it does is a random number generator makes a number, then from a data file full of fortunes, it picks the line corresponding with the number. What I can't get it to do is to tell the function for reading the file (ReadFile) what the random number is.
Here is my code:
fyi: I'm programming this in textbased telnet linux.
// Global Constants
const int NUM = 0;
// Function Prototypes
apstring ReadFile ( NUM );
cout<<" ----The Super Fortune Teller----"<<endl<<endl;
cout<<" warning: all fortunes generated that come true are purely
coincidental and do not reflect the ability of our staff
or this generator."<< endl;
cout<<" Now.... To recieve your fortune<<endl<<endl<<endl<<endl;
cout<< "This is your fortune.........."<<endl;
ReadFile( NUM );
srand ( unsigned (time(0)));
NUM = rand()%2;
getline( inFile, NUM);
any help would be apreciated. Thanks
edit:: oops, I forgot to tell you how the data file is set up.....
1 You will eat a lot today
2 You will be attracted to a co worker today
3 don't go outside, the weather is bad