| | |
whats wrong with my code??
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
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
its suppose to be cards....
sorry if my spelling is bad

C Syntax (Toggle Plain Text)
#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?
its suppose to be cards....
-----------------------------------
What's wrong? it doesn't run as you expect or it shows the error when trying to compile?
Yesterday is a history, tomorrow is a mystery, today is a gift.
Behind every smile is a tear.
Visal .In
Behind every smile is a tear.
Visal .In
i get an error when i try to run it...
4 to be exact...
one in this line
and one in the line uder this one
one here
and at
4 to be exact...
one in this line
C Syntax (Toggle Plain Text)
void set_deck(deck[])
C Syntax (Toggle Plain Text)
{
C Syntax (Toggle Plain Text)
int i=0,j=0,counter=0;
C Syntax (Toggle Plain Text)
set_deck(deck);
void set_deck(cards deck[]) Yesterday is a history, tomorrow is a mystery, today is a gift.
Behind every smile is a tear.
Visal .In
Behind every smile is a tear.
Visal .In
>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.
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.
New members chased away this month: 3
![]() |
Similar Threads
- Please help me figure out whats wrong with my code (C++)
- whats wrong with my code cant display result (C)
- Whats wrong with this class??? (C++)
- Whats wrong with this code (PHP)
- Hello Everyone, I need Help with my C++ Code... (C++)
Other Threads in the C Forum
- Previous Thread: How should I code this?
- Next Thread: linked list error
| Thread Tools | Search this Thread |
Tag cloud for C
adobe ansi api array arrays asterisks binarysearch calculate centimeter char command convert copyimagefile copypdffile cprogramme creafecopyofanytypeoffileinc createcopyoffile csyntax directory drawing dynamic executable fflush file fork forloop frequency getlasterror givemetehcodez graphics gtkgcurlcompiling hacking hardware highest homework i/o inches incrementoperators infiniteloop kernel km lazy linked linkedlist linux linuxsegmentationfault list lists locate logical_drives match matrix microsoft motherboard multi mysql number open opendocumentformat opensource owf pattern pdf performance pointer pointers posix problem probleminc program programming radix recursion recv repetition research scanf scheduling scripting segmentationfault send sequential shape socketprograming spoonfeeding stack standard string strings structures student systemcall testautomation turboc unix user variable voidmain() wab windows.h







