avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Problem with structure


From: Daniel O'Connor
Subject: Re: [avr-gcc-list] Problem with structure
Date: Mon, 3 Oct 2005 14:30:01 +0930
User-agent: KMail/1.8.2

On Monday 03 October 2005 11:59, wbounce wrote:
> I get this error
>
> DoSonar.c:110: error: request for member `Front' in something not a
> structure or union
>
> On this line.
>
> Sonar[SonarIndex].Front = SonarRange;
>
> What am I doing wrong?

Have you tried building with -Wall?
Is this your only error message?

I just tried it and it works for me..
#include <sys/types.h>

typedef struct ranges_t {
    uint16_t          Front;
    uint16_t          Left;
    uint16_t          Right;
} RANGES;

int
main(int argc, char **argv) {
    RANGES Sonar[2];

    Sonar[0].Front = 1;
}

-- 
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C

Attachment: pgpaQDV9J_XXv.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]