[A89] random numbers, pointers, problems


[Prev][Next][Index][Thread]

[A89] random numbers, pointers, problems




   do
   {
    temp2=random(52);
   }
   while((*cards+temp2)==0);
   *cards=*cards+temp2;
   cards_placed[temp]=(*cards);
   (*cards)=0;
   *cards=*cards-temp2;

cards is of unsigned character type, temp2 is unsigned character as well,
and temp is integer.

Why on earth am I getting numbers upwards of 200 in the cards_placed[]
array?

Matthew Landry





Follow-Ups: References: