home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!asuvax!ncar!noao!amethyst!organpipe.uug.arizona.edu!news
- From: dave@cs.arizona.edu (Dave Schaumann)
- Newsgroups: comp.lang.c
- Subject: Re: Would this be the place to...
- Message-ID: <1992Aug17.052236.11021@organpipe.uug.arizona.edu>
- Date: 17 Aug 92 05:22:36 GMT
- References: <1992Aug8.052246.14904@mailer.cc.fsu.edu>
- Sender: news@organpipe.uug.arizona.edu
- Reply-To: dave@cs.arizona.edu (Dave Schaumann)
- Organization: University of Arizona
- Lines: 38
- In-Reply-To: c3460344@fsu1.cc.fsu.edu (C3460344)
-
- In article <1992Aug8.052246.14904@mailer.cc.fsu.edu>, c3460344@fsu1 (C3460344) writes:
- >If I have a piece of code that I am having trouble finding a problem in,
- >would I post it here? It is about 50 or so lines...
-
- It's been done before. I generally read news on a 45-or-so line screen;
- When I see "what's wrong with this" followed by more than half a screen
- of code, I almost always immediatley 'n' right by it.
-
- >I am getting garbage in the trans_type element of this structure when I
- >print it to screen:
- >
- >typedef struct {
- > char date[9];
- > char cknum[4];
- > char comment[21];
- > char trans_type[4];
- > float amount;
- >} entry;
-
- >So, I am assuming that I am lacking some variable initialization.
-
- Could also be field overflow; if you try to put more than 21 characters
- in your `comment' field, most likely it'll overflow into `trans_type'.
-
- >How would I go about initializing an
- >array full of these structures
-
- assuming you mean constant initialization:
-
- entry Register[MAX] = {
- { "8/16/92", "100", "loan payment", "w", 200.00 },
- { "8/17/92", "101", "tuition" , "w", 1234.56 },
- { "8/21/92", "" , "pay day!" , "d", 63.27 },
- { "", "", "", "", 0.0 }
- } ;
-
- --
- Dave Schaumann dave@cs.arizona.edu
-