Hallo,
kurze Frage,
Wieso verbraucht eine "struct Variable" gleicher Typ, bisschen mehr Speicherplatz als eine normale Variable innerhalb einer Funktion?
struct variable
CodeBox C
"normale" variable
CodeBox C
vorallem diese variable vom typ struct benutze ich schon für andere Sachen mit, dass müsste doch eigentlich nen Byte weniger sein wenn die "normale" Variable weg fällt oder?
kurze Frage,
Wieso verbraucht eine "struct Variable" gleicher Typ, bisschen mehr Speicherplatz als eine normale Variable innerhalb einer Funktion?
struct variable
CodeBox C
int8_t ADE7758_readTEMP(void) { ADE7758.Raw_Data[0] = 0; ADE7758.Raw_Data[0] = (int8_t)ADE7758_read_int8(REG_TEMP); // raw data ADE7758.Raw_Data[0] -= (int8_t)40; // offset for this sensor ADE7758.Raw_Data[0] *= (int8_t)3; // 3°C/Bit //ADE7758.Raw_Data[0] += 21; // ambient temperature return ADE7758.Raw_Data[0]; }
"normale" variable
CodeBox C
int8_t ADE7758_readTEMP(void) { int8_t temperature = 0; temperature = ADE7758_read_int8(REG_TEMP); // raw data temperature -= 40; // offset for this sensor temperature *= 3; // 3°C/Bit //temperature += 21; // ambient temperature return temperature; }
vorallem diese variable vom typ struct benutze ich schon für andere Sachen mit, dass müsste doch eigentlich nen Byte weniger sein wenn die "normale" Variable weg fällt oder?