C
Chris Hiler
Why isn't it possible to assign a value to a struct at run time?
In my header file I have something like this:
typedef struct SomeStruct_t
{
int Member1;
int Member2;
int Member3;
};
then in main.c I declare somthing like this:
struct SomeStruct_t ExampleStructure;
Then in main all I want to do is this:
void main(void)
{
ExampleStructure.Member1 = 1;
}
My compiler tells me that '=' is an incompatible operator. It might
help to know that I'm using a keil 8051 C compiler, and it isn't
totally ANSI-C compliant. If someone could let me know what I'm doing
wrong or give me some guidance I'd really appreciate it.
Thanks,
Chris
In my header file I have something like this:
typedef struct SomeStruct_t
{
int Member1;
int Member2;
int Member3;
};
then in main.c I declare somthing like this:
struct SomeStruct_t ExampleStructure;
Then in main all I want to do is this:
void main(void)
{
ExampleStructure.Member1 = 1;
}
My compiler tells me that '=' is an incompatible operator. It might
help to know that I'm using a keil 8051 C compiler, and it isn't
totally ANSI-C compliant. If someone could let me know what I'm doing
wrong or give me some guidance I'd really appreciate it.
Thanks,
Chris