•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 456,234 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,817 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums
Views: 318 | Replies: 1
![]() |
•
•
Join Date: Oct 2007
Posts: 40
Reputation:
Rep Power: 2
Solved Threads: 0
i received some help but when i implimented it into the program it came up with an error. if anyone could help me fix this problem i will greatly appreciate it. here is the program. it is a guessing game. the error message says:
error C2064: term does not evaluate to a function taking 1 arguments. it is talking about the following line: srand((unsigned)time(0))
error C2064: term does not evaluate to a function taking 1 arguments. it is talking about the following line: srand((unsigned)time(0))
c++ Syntax (Toggle Plain Text)
#include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main () { int num; int guess; bool done; int noOfGuesses=0; int ncount; int sum=0; int noofgamesplayed; int avgNoOfGuesses; int time; sum += noOfGuesses; avgNoOfGuesses=sum/noofgamesplayed; [color="Red"]srand((unsigned)time(0))[/color] ;num = (rand() % 1000); done = false; while ((noOfGuesses < 10) && (!done)) { cout << "Enter an integer greater" << " than or equal to 0 and " << "less than 1000: "; cin >> guess; cout << endl; noOfGuesses++; if (guess == num) { cout << "you guessed the correct " << "number." << endl; done = true; } else if (guess < num) cout << "Your guess is lower " << "than the number. \n" << "Guess again!" << endl; else cout << "Your guess is higher " << "than the number.\n" << "guess again!" << endl; cout <<"Total gueses equal " << noOfGuesses << endl; } return 0; }
Last edited by Ancient Dragon : Nov 12th, 2007 at 9:16 pm. Reason: corrected code tags and add line numbers
![]() |
•
•
•
•
•
•
•
•
DaniWeb C++ Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- error message in program (C++)
- Solution to 3MB Error Message :) (Windows tips 'n' tweaks)
- error message whe installing a program (Windows NT / 2000 / XP / 2003)
- Error message when I run my program in C++ (C++)
- javayk.dll RUNDLL Error message at startup (Viruses, Spyware and other Nasties)
- Error message on start up - bridge.dll file missing (Viruses, Spyware and other Nasties)
- RUNDLL Error Message at Boot (Viruses, Spyware and other Nasties)
- Help! C:\WINNT\system32\bridge.dll error message (Viruses, Spyware and other Nasties)
Other Threads in the C++ Forum
- Previous Thread: I Need Help
- Next Thread: Output Issue Using Arrays



Linear Mode