interview questions and answers

Technical Interview Questions | C Interview Questions

Home interview questions Programming interview questions C 
Friday, 10 February 2012
Main Menu
Home
Online Test
Contest
Search
FAQs
Contact Us
Login
Most Popular Category
JAVA

Microsoft Technologies
ASP, C#, DotNet, ...

Programming
C++, PHP, VB, ...

SAP

Testing

Web Technologies

Polls
Does personal networking help in job search?
 
IT Placement Papers interview questions Programming interview questions C

This category contains C Interview Questions and Answers


How can I determine the byte offset of a field within a structure?

PDF Print E-mail

ANSI C defines the offsetof() macro, which should be used if available; 
If you don't have it, one possible implementation is

#define offsetof(type, mem) ((size_t) \ ((char *)&((type *)0)->mem - (char *)(type *)0))

This implementation is not 100% portable; some compilers may legitimately refuse to accept it.




Be first to comment this article

Only registered users can write comments.
Please login or register.

 
< Prev   Next >

Technical Interview Questions | C Interview Questions

Top!
Top!
Copyright © 2008 InterviewDuniya.com All Rights Reserved.
Partner Site: Maheshwari Matrimony