Apr
20

Little endian and Big endian in C programming

This is the most complex concept…. i have read enough on net and some books but   still i was not getting this concept. i was not understanding how this will effect my c code. But i have did some  experiments with some example code and tried to understand things. and here now i am going to share those examples.

In computing, the term endian or endianness refers to the ordering of individually addressable sub-components within the representation of a larger data item as stored in external memory (or, sometimes, as sent on a serial connection)

You can understand basic things about at 

Little endian and Big endian

Big-endian

Big-Endian.svg

The most significant byte (MSB) value, which is 0Ah in our example, is stored at the memory location with the lowest address, the next byte value in significance, 0Bh, is stored at the following memory location and so on. This is akin to Left-to-Right reading in hexadecimal order.

Little-endian

Little-Endian.svg

The least significant byte (LSB) value, 0Dh, is at the lowest address. The other bytes follow in increasing order of significance.


Now lets see with some code

 

 

JIGAR PATEL

hey I am an Artist who love to write code…! Well I am an EC graduate From Ganpat University and now i am working as Embedded software engineer in one private firm.. find me at here JigAr Patel

More PostsWebsiteTwitterFacebook

You may like to read this also....

2 Comments to “Little endian and Big endian in C programming”

Post comment

*

CommentLuv badge
Follow us on Twitter! Follow us on Twitter!

Search in this website

our sponsors

latest comments

Find us on Facebook

Top Authors

35 posts
saurabh
22 posts
10 posts

Find us on stackoverflow

Polls

Tell us who you are

View Results

Loading ... Loading ...

My Bookmarks

Sponsers Link