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

Pages: 1-

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 11:35

ignore that. fool like me declaring int rand(); as nothing. :x
sorry.

Name: Anonymous 2007-12-11 11:37

Another thing though.
how do I use my random number and put it into a new int (that won't change again) to be used in other parts of my program?

Name: Anonymous 2007-12-11 11:39

this is the worst thread ever

Name: Anonymous 2007-12-11 11:43

>>4 is the worst troll ever.

Name: Anonymous 2007-12-11 12:00

>>5
>>4 was until >>7 posted

Name: Anonymous 2007-12-11 12:02

>>5
no u

Name: Anonymous 2007-12-11 12:02

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

Name: Anonymous 2007-12-11 12:02

>>8
fuck

Name: Anonymous 2007-12-11 12:06

goto >>8

Name: Anonymous 2007-12-11 14:31

>>8
>>10
CONSIDERED OFFENSIVE

Name: Anonymous 2009-03-06 6:12

The heat vision in   splinter cell Python.

Name: Anonymous 2009-03-06 13:59

Com/digamitusmyspace.

Name: Anonymous 2010-11-13 19:33

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