Problem in my program (Please help!) 
Author Message
 Problem in my program (Please help!)

Hi! I'm writing a fairly simple game using this data structures below (amongst others) I have two linked lists of decks of cards - mail cards and deal cards.
An array of player records, and a function adjustcash, that is simple at the moment, but will be added to later. Here is the code, my problem is, it won't even compile - so I assume I am making some incorrect assumptions about c. Please help! T.I.A.
                Okesan (aurora.cc.monash.edu.au!ins499y)
B.T.W. Reply by mail is probably better, no need to waste bandwidth over my small problems!!!

typedef struct player APLAYER;
typedef struct dealtype ADEAL;
typedef struct mailtype AMAIL;
void adjustcash(int playr, int amount);
struct mailtype {
        char title[25], message[], chargemess[10];
        int charge;
        enum CARD_TYPE cardtype;
        AMAIL *nextmail;

Quote:
};

struct player {
        int cash, bills, loan, savings, position, month, insurance;
        ADEAL *deals;
        AMAIL *mails;
Quote:
};

struct dealtype {
        char title[25];
        int cost, value, commission;
        ADEAL *nextdeal;
Quote:
};

APLAYER players[MAXPLAYERS];
ADEAL *firstdeal, *thisdeal, *newdeal;
AMAIL *card;
ADEAL readdeal;
FILE *fptr;

void adjustcash(int playr, int amount)
{
        players[playr].cash += amount;

Quote:
} /* end adjustcash */

/* These are the lines in my program that are having problems */
                if (getch == 'y' || 'Y') /* can you do this in c? */
                adjustcash(curplayer,-(*card->charge));
                if(curplayer.deals == (ADEAL*)NULL )
                /* C doesn't seem to like dealing with curplayer.deals as a normal ADEAL type pointer. */
                thisdeal = curplayer.deals;
                while ( fread(readdeal,sizeof(readdeal),1,fptr) == 1)
                /* Here I am trying to read the deal deck from disk, structure by structure, first into readdeal. But this doesn't work either!!! */


Fri, 22 Sep 1995 11:08:36 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Problem in my program.....Please Help

2. Need help on this programming problem ( PLEASE HELP!!!)

3. Please help!!!!Please help!!!!Please help!!!!Please help!!!!Please help!!!!Please help!!!!Please help!!!!

4. program problem, please HELP!!!

5. Problem with Program!!Please Help (AGAIN).

6. Please help-two problems with C program

7. HELP w/ C Programming Problem...PLEASE!!

8. A C program problem, Please help!

9. A C Program Problem-Please Help!

10. Please Beginner Help with C programming problem.

11. Please help beginner with programming problem

12. Programming problems..please help

 

 
Powered by phpBB® Forum Software