1.

In the directive #pragma pack(n), if the value of ‘n’ is given to be 5, then what happens?(a) Error(b) Warning but no error(c) Executes the pragma statement(d) Ignores the pragma statement and executes the programI had been asked this question in an internship interview.My doubt stems from Pragma in portion C Preprocessor of C

Answer»

Right choice is (d) Ignores the PRAGMA STATEMENT and executes the program

Explanation: Valid values for n are 1,2,4 and 8. If the value of n is one that the COMPILER does not recognize, then it simply ignores the pragma statement without THROWING any error or warning.



Discussion

No Comment Found

Related InterviewSolutions