im trying to make a function that will fill an array with numbers but something seems to be wrong =\
its suppose to be cards....
sorry if my spelling is bad :P
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
typedef struct{
int num,sute,joker,in_use,arr_place;
} card;
void set_deck(deck[])
{
clrscr();
int i=0,j=0,counter=0;
for(j=1;j<=4;j++)
for(i=1;i<=13;i++)
{
deck[counter].num=i;
deck[counter].sute=j;
deck[counter].joker=0;
deck[counter].in_use=0;
deck[counter].arr_place=counter;
counter++;
}
for(i=0;i<2;i++)
{
deck[counter].in_use=0;
deck[counter].num=0;
deck[counter].sute=0;
deck[counter].joker=1;
deck[counter].arr_place=counter;
counter++;
}
for(i=0;i<54;i++)
{
printf("no. %d sute %d in use %d joker %d the I is %d arr_place %d\n",deck[i].num,deck[i].sute,deck[i].in_use,deck[i].joker,i,deck[i].arr_place);
}
}
void main(void)
{
card deck[54];
set_deck(deck);
getch();
}