Re: What is the proper Syntax for this Pointer?



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 "->".
.