Please help me. I am new to C and working on a zilog micro. I need to read all elements of a structure I have set up and write theses bytes to EEPROM.
I thought the way was to increment a pointer to the structure, but seem not to have much success doing this. Please advise how to go about this.
My code is:
struct Calib // Structure to hold calibration data
{
int DcOffset[3]; // Array [x1,x10,x100]
signed int CorrFctr[2][3][3]; // Array [V,I] [Red,White,Blue] [x1,x10,x100]
} CalData;
struct Calib *st_ptr;
for (i = 0; i <= 80; i++)
{
printf("Value at this address is: %d \n", st_ptr);
*st_ptr++;
}
Also, Please advise if one can assign constants in a struct. For example, can I add the element below, to the structure:
unsigned int CalVal[2][3] = {{230, 230, 230}, {25, 5, 1}};