C

Bit fields

Në shqip: Fushat me bit-e

ShpjegimiSQ

Te bit fields, një fushë e struct-it zë vetëm aq bit-e sa i thua — unsigned ndezur : 1; Kursen memorie në pajisje të vogla dhe në protokolle rrjeti.

EnglishEN

With bit fields, a struct field takes only as many bits as you specify — unsigned on : 1; It saves memory on small devices and in network protocols.

Si ta mendosh

Si kutitë e ilaçeve me ndarje të vogla për çdo ditë, në vend të një kutie të madhe për secilin.

Lexoje në anglisht

Like a pill organiser with small compartments per day, instead of a big box for each.

Shembull kodic

struct Cilesimet {
    unsigned drita  : 1;
    unsigned zeri   : 1;
    unsigned niveli : 3;   // 0..7
};

Terma të lidhur