Structure Padding

How can I use Structure padding and I want to re-use the remaining memory further?
ex: struct num {
char ch;
int i;
char s;
};

Editorial / Best Answer

Answered by: Mantu

  • Dec 6th, 2017


By using #pragma pack(1) we can reduce the size of structure.

Code
  1. #pragma pack(1)
  2. "Size of num structure is %d "

Showing Answers 1 - 1 of 1 Answers

Mantu

  • Dec 6th, 2017
 

By using #pragma pack(1) we can reduce the size of structure.

Code
  1. #pragma pack(1)

  2. "Size of num structure is %d "

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions