Re: What is the proper Syntax for this Pointer?
- From: James Kuyper <jameskuyper@xxxxxxxxxxx>
- Date: Fri, 30 Nov 2007 13:06:45 GMT
Neil wrote:
....
The structs ( minus the uneeded stuff)are
struct adaptorBatteryData
{
struct batteryData const *battery;
};
struct adaptorData
{
struct adaptorBatteryData const *batData;
};
struct batteryData
{
};
struct adaptorBatteryData const *batPointer;
adaptors[position].batteries[channel] = adaptors[position].adaptor[channel].batData->battery;
Gives the error "structure required on left side of . or *."
What is missing from what you just gave us is the data type for adaptors[position] and adaptors[position].adaptor[channel]. As written, your code requires that they both be structures. The message that was generated implies that at least one of those expressions is a pointer to a structure. If that is the case, then the your problem is due to the fact that you've used "." rather than "->".
.
- References:
- What is the proper Syntax for this Pointer?
- From: Neil
- Re: What is the proper Syntax for this Pointer?
- From: James Kuyper
- Re: What is the proper Syntax for this Pointer?
- From: Neil
- What is the proper Syntax for this Pointer?
- Prev by Date: library function vs system calls
- Next by Date: Re: library function vs system calls
- Previous by thread: Re: What is the proper Syntax for this Pointer?
- Next by thread: gcc printf conversion specification for struct timeval
- Index(es):