what does it mean to dereference array of structures?

struct ConfigConnection
  ParameterId metered;     // ParameterId type is "enum"
  ParameterId calibration;

// contents of this array are just numbers
const ConfigConnection ParameterGenerator::connections[] =
  {ParameterId_GeneratorVoltageAB, ParameterId_CalibrationFactorVoltageAB},
  {ParameterId_GeneratorVoltageBC, ParameterId_CalibrationFactorVoltageBC},
  {ParameterId_GeneratorVoltageCA, ParameterId_CalibrationFactorVoltageCA},
  {ParameterId_GeneratorVoltageAN, ParameterId_CalibrationFactorVoltageAN},
  {ParameterId_GeneratorVoltageBN, ParameterId_CalibrationFactorVoltageBN},
  {ParameterId_GeneratorVoltageCN, ParameterId_CalibrationFactorVoltageCN},
  {ParameterId_GeneratorCurrentA , ParameterId_CalibrationFactorCurrentA},
  {ParameterId_GeneratorCurrentB , ParameterId_CalibrationFactorCurrentB},
  {ParameterId_GeneratorCurrentC , ParameterId_CalibrationFactorCurrentC},

for(short i = 0; i < (sizeof(connections)/sizeof(*connections)); ++i)

What does   *connections mean?
Who is Participating?
ZoppoConnect With a Mentor Commented:
Hi naseeam,

this *connection simply is the first element pointed to by connection, i.o.w. it's similar to connection[0]. Thus the expression (sizeof(connections)/sizeof(*connections)) returns the number of elements in connections.

Hope that helps,

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.