dobry den, potreboval by som prekonvertovat pole bytov na strukturu a sposob ako k nej pristupovat,je to pre 8bit mikrokontroler (FAT16 na SD karte) cize som obmedzeni pamatov,konkretne by som si to predstavoval nejak takto:
//chcem mat napr 2 struktury
struct masterBootRecord
{
unsigned char exatubleCode[446];
unsigned char partitionInfo[64];
unsigned int executableMark;
};
struct partitionInfo
{
unsigned char status;
unsigned char startHead;
unsigned int startSectorCylinder;
unsigned char type;
unsigned char endHead;
unsigned int endSector;
unsigned long sectorToStart;
unsigned long size;
};
//teraz chcem prekonvertovat pole na strukturu
struct masterBootRecord *mbr=(struct masterBootRecord *)buffer;
//a este by som chcel prekonvertovat pole partitionInfo[64] v strukture na viac struktur partitionInfo
struct partitionInfo *prt=(struct partitionInfo *)((mbr)->partitionInfo);
//a teraz by som chcel vediet ked napisem
a=(prt+1)-> startHead;
//co je vlastne v premennej a, hodnota ? som z toho mimo.