UrbanPro

Learn C Language from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

Are bit fields portable?

Asked by Last Modified  

Follow 1
Answer

Please enter your answer

Professional Tutor with 15 years of experience.

Yes, This makes the representation compiler-independent. i.e. they are portable, but what they do may not necessarily be exactly what a person actually wanting to manipulate individual bits may need. Bit fields are standard language feature. They will compile in all C compilers.
Comments

Computer Wizard

Bitfields are not quite as portable as you think, as "C gives no guarantee of the ordering of fields within machine words" Ignoring that, used correctly, either method is safe. Both methods also allow symbolic access to integral variables. You can argue that the bitfield method is easier to write,...
read more
Bitfields are not quite as portable as you think, as "C gives no guarantee of the ordering of fields within machine words" Ignoring that, used correctly, either method is safe. Both methods also allow symbolic access to integral variables. You can argue that the bitfield method is easier to write, but it also means more code to review. read less
Comments

Trainer

This makes the representation compiler-independent. i.e. they are portable, but what they do may not necessarily be exactly what a person actually wanting to manipulate individual bits may need. Bit fields are standard language feature. They will compile in all C compilers.
Comments

Computer & Maths Professor

They are portable in that sense of the term. Your code is well-formed and will compile in all C compilers as well. Statements like "bit-fields are not portable" usually mean that the physical layout of bit-fields in memory might differ from implementation to implementation (i.e. from one compiler to...
Comments

View 2 more Answers

Related Questions

What is the difference between compile time error and run time error?
Compile error is the error when you check for syntax error while run time error comes when you do execution of the program.
Varada
0 0
6
Can the last case of a switch statement skip including the break?
Last case if a switch should be DEFAULT.. Good to have this case always. Executed only when there's no other matching cases found.
Sanjeev
In how many days can we learn the C language?
Around one month and depends upon you how much time you give.
Ravi Shankar
0 0
9
What is the importance of pointers? People stress more on them. Why they are useful actually what is their importance?
Importance of pointers:- Pointers are used in situations when passing actual values is difficult or not desired. To return more than one value from a function. They increase the execution speed. The...
Pati
How do you override a defined macro?
We can use the #ifdef and #undef directive to undefine a previously defined macro.
Sharmistha

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

Lets know about far, near and huge pointers for fresher interview purpose
All of these three candidates relate to 16 bit architecture where segmented memory architecture was there. They are not at all relevant for present days 32 or 64 bit architecture where the way of memory...

What is Safety-Critical Software?
A software whose failure may cause death or injuries to the users called Safety-Critical Software.The software present as part of Aeroplanes, or present in Rail as railway signalling software or Automotive...


Variables
Variables in C Language:A variable is a name that may be used to store a data value. Unlike constant, variables are changeable, we can change value of a variable during execution of a program. A programmer...

Some interview questions for freshers on C language
Q1. What are the two forms of #include? There are two variants of #include. The one is #include and the other one is #include”file”. In general the first form that is #include is used to...

Recommended Articles

Lasya Infotech is a Hyderabad based IT training institute founded in 2016 by O Venkat. Believing in his innovation, passion and persistence and with a diverse blend of experience, he started his brainchild to deliver exemplary professional courses to aspiring candidates by honing their skills. Ever since the institute envisions...

Read full article >

Brilliant Academy is one of the reputed institutes for B.Tech tuition classes. This institute is specialised in delivering quality tuition classes for B.E, Engineering - all streams and Engineering diploma courses. Incorporated in 2012, Brillant Academy is a brainchild of Mr Jagadeesh. The main motto of the academy is to...

Read full article >

Applications engineering is a hot trend in the current IT market.  An applications engineer is responsible for designing and application of technology products relating to various aspects of computing. To accomplish this, he/she has to work collaboratively with the company’s manufacturing, marketing, sales, and customer...

Read full article >

Whether it was the Internet Era of 90s or the Big Data Era of today, Information Technology (IT) has given birth to several lucrative career options for many. Though there will not be a “significant" increase in demand for IT professionals in 2014 as compared to 2013, a “steady” demand for IT professionals is rest assured...

Read full article >

Looking for C Language Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for C Language Classes?

The best tutors for C Language Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn C Language with the Best Tutors

The best Tutors for C Language Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more