Pointer exercise 1

typedef int portPinArray01[2];
const int portNumber1 = 1;
const int pinNumber1  = 2;

portPinArray01 portPinArray01x = {portNumber1, pinNumber1};
portPinArray01 portPinArray02x = {portNumber1, pinNumber1};
portPinArray01 portPinArray03x = {portNumber1, pinNumber1};

portPinArray01 *portPinArrayPointer01x = &portPinArray01x;
portPinArray01 *portPinArrayPointer02x = &portPinArray01x;
portPinArray01 *portPinArrayPointer03x = &portPinArray01x;

portPinArray01 *PortPinArrayPointerArray01x[3] = {&portPinArray01x, &portPinArray01x, &portPinArray01x};

portPinArray01 *getPortPinArray01(deviceNumber deviceNumber)
{
  portPinArray01 *portPinArray04xptr;

portPinArray04xptr = PortPinArrayPointerArray01x[0];

return portPinArray04xptr;
}

.END

No comments:

Post a Comment