[New post] C TRICKS- Part Three

13 views
Skip to first unread message

Encapsulate {Ideas}

unread,
Aug 17, 2015, 1:34:42 PM8/17/15
to post.encap...@gmail.com
karan1311 posted: "Structure A Structure always allocates memory in the form of block, and block size depends on the longest data member of the structure. If a structure contains a slack byte, it's called an Imbalanced Structure. Word alignment is required to "
Respond to this post by replying above this line

New post on Encapsulate {Ideas}

C TRICKS- Part Three

by karan1311

Structure

  • A Structure always allocates memory in the form of block, and block size depends on the longest data member of the structure.
  • If a structure contains a slack byte, it's called an Imbalanced Structure.
  • Word alignment is required to covert imbalanced structure into balanced structure.
  • A structure cannot be nested within the same structure, unless the nested structure is a pointer, i.e., self-referential structure.
  • Structures are used for data encapsulation, memory links and bit-fields.
  • Two structure variables cannot be compared.
  • One structure variable can be assigned to another structure variable, if both belong to the same structure.
  • Bit Field is a unique feature in C which can be applied to a structure for memory optimization.
  • Each data member of a structure begins at different places.
  • Bit Field range must be between 1 and the size of its data member.
  • Bit Field is not allowed for float data members.
  • Union provides a way to share common memory in different ways.
karan1311 | August 17, 2015 at 5:34 pm | Tags: c, programming | Categories: C Tricks | URL: http://wp.me/p5JOdg-as

Comment    See all comments    Like

Unsubscribe to no longer receive posts from Encapsulate {Ideas}.
Change your email settings at Manage Subscriptions.

Trouble clicking? Copy and paste this URL into your browser:
https://encapsulateideas.wordpress.com/2015/08/17/c-tricks-part-three/

Thanks for flying with WordPress.com

Reply all
Reply to author
Forward
0 new messages