Mailinglist Archive: opensuse-programming (68 mails)

< Previous Next >
Re: [suse-programming-e] C++ compile problem. error in function
  • From: Trey Gruel <drathos-suse@xxxxxxxxxxxxxx>
  • Date: Mon, 12 Jan 2004 14:06:09 -0500 (EST)
  • Message-id: <Pine.LNX.4.44.0401121400560.28774-100000@xxxxxxxxxxxxxxxxxxxxx>
> Structures are global and are as follows:
<snip>
> struct BillLine
> {
> StockItem stock;
> float weight;
> float cost;
> }bill_line[50];
<snip>
> My full program code is as follows
<snip>
> struct BillLine
> {
> StockItem stock[NUM_OF_ITEMS];
> float weight;
> float cost;
> }bill_line[50];

notice the difference between the two declarations of BillLine. the
problem you're having is becuase in the full code, you're trying to assign
a single StockItem to an array of them without referencing a single array
location. the second error has the same cause. you're trying to access
the desc value but treating it as a single StockItem, not an array.

--
trey


< Previous Next >
References