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();

   }

im trying to make a function that will fill an array with numbers but something seems to be wrong =\
its suppose to be cards....

-----------------------------------
What's wrong? it doesn't run as you expect or it shows the error when trying to compile?

i get an error when i try to run it...
4 to be exact...
one in this line

void set_deck(deck[])

and one in the line uder this one

{

one here

int i=0,j=0,counter=0;

and at

set_deck(deck);
void set_deck([B]cards[/B] deck[])

thankyou
now i have just one error in

int i=0,j=0,counter=0;

=\

you should take the
int i=0 ;
int j=0;
int counter =0 ;
before clrscr();

yess thenkyou very much :)
one more thing....
how do i do outtextxy to a int??
like printf("%d",a); only in outtextxy...

yess thenkyou very much :)
one more thing....
how do i do outtextxy to a int??
like printf("%d",a); only in outtextxy...

What is outtextxy?

>What is outtextxy?
It's a function from BGI's graphics.h library that writes a string to the screen at specific x,y coordinates.

>how do i do outtextxy to a int??
You have to convert the int to a string first. Search the forum, there are plenty of threads on that particular topic.

is there something like outtextxy for int's or do i have to turn it into a string first???
if there is something like that pleas tell me coz i never learned strings =\

Use sprintf() to convert an integer to string.

>is there something like outtextxy for int's or do i have to turn it into a string first???
Good question! How about we take a look at the post immediately above yours:

>how do i do outtextxy to a int??
You have to convert the int to a string first.

It's conclusive then. You have to convert the int to a string first. :icon_rolleyes:

>if there is something like that pleas tell me coz i never learned strings =\
I think we have a solution to this dilemma. Let's look at the post immediately above yours:

Search the forum, there are plenty of threads on that particular topic.

Wow! It's like all of your questions are answered before you ask them! :icon_rolleyes:

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.