1.

The function of __attribute__((packed)); can also be performed using _________(a) #pragma pack(1);(b) #pragma pack(2);(c) #pragma pack(4);(d) #pragma pack(8);The question was asked in examination.The above asked question is from Pragma topic in section C Preprocessor of C

Answer»

The correct answer is (a) #PRAGMA PACK(1);

The best I can EXPLAIN: __attribute((packed)); and #pragma(1) are used to perform the same function, that is, to DIRECT the COMPILER to pack the structure.



Discussion

No Comment Found

Related InterviewSolutions