By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 924 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

randomize(); or random prototype

P: 1
Hi,
I was working on the random functions programs and i dont know the prototypes for random and randomize please can some one help me ??
Expand|Select|Wrap|Line Numbers
  1. #include<iostream.h>
  2. #include<conio.h>
  3. #include<stdio.h>
  4. const int max=3;
  5. void main()
  6. {
  7. randomize();
  8. int number;
  9. number=50+random(max);
  10. for(int p=number;p>=50;p--)
  11. cout<<p<<"#";
  12. cout<<endl;
  13.  
errors
Function 'randomize' should have a prototype
function 'random'should have a prototype
Nov 4 '15 #1
Share this Question
Share on Google+
2 Replies


weaknessforcats
Expert Mod 5K+
P: 9,197
Where did you hear about these functions?

The only ones I know about are rand() for generating a random number and srand() for seeding the random number generator. Both of these functions have prototypes in <stdlib.h>.
Nov 4 '15 #2

Expert 100+
P: 2,396
By the way, you should change line 5 such that main returns an int.
Nov 4 '15 #3

Post your reply

Sign in to post your reply or Sign up for a free account.