Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

i has problem

Name: Anonymous 2007-12-11 11:33

#include <iostream>
#include <cstdlib>
#include <time.h>

using namespace std;

main()

{
     
      time_t sec;
      time(&sec);
      srand((unsigned int) sec);
      int rand();
      int dice = rand()%6 +1;
     

      int junkdata;
     
      cout << "\n" << dice;
     
     
      cin >> junkdata;
     
      return 0;
     
}

Errors are.

[linker error] undefined reference to 'rand()'
and
Id returned 1 exit status.

everyones gotta learn somewhere. so don't troll much please. :/
also.
what do I use to make the program stay open when i'm testing it, currently i'm using an input just so it waits for that last input >_>.
surely thats not the way to do it? thanks.

Name: Anonymous 2007-12-11 12:02

if >>8 then goto >>6 else goto >>10

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List