Q:

random numbers not generating properly ? (C++)

I am currently using these functions in C++ to find a number and a suit for a card. 
  int getnumber () {
             srand(time(0));
             int number ;
             number = rand()% 13 + 1;
             return number;
             };

         int getsuitn () {
             srand(time(0));
             int suitn;
             suitn = rand() % 4 + 1;
             return suitn;
             }

the output is always just the default constructor for the class, I have all the libraries needed to make this work, what am I doing wrong?

A:

With the same seed the same sequence will be generated every time.  Since you seed with the current time in seconds, every call you make in the same second will get the same first number from the sequence.  Your whole program probably runs in under a second, so they all get the same result.
Seed the random number generator once at the start of your program.

