Advertisement

06.06.2008 at 02:39PM PDT, ID: 23465167
[x]
Attachment Details

Align BYTE pointer on DWORD Boundry

Asked by ac506 in C++ Programming Language

Tags: c++

I was going through some code and I found one macro to align byte ptr
to DWORD boundry.


#define DWORD_ALIGN( base, ptr ) \
    ( (LPBYTE)(base) + ((((LPBYTE)(ptr) - (LPBYTE)(base)) + 3) & ~3) )


I am not able to understand how this works.


can anyone throw some light on this?


IS there any good material to read about this?Start Free Trial
[+][-]06.06.2008 at 03:23PM PDT, ID: 21733129

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: C++ Programming Language
Tags: c++
Sign Up Now!
Solution Provided By: davidgeldreich
Participating Experts: 1
Solution Grade: A
 
 
[+][-]06.06.2008 at 03:27PM PDT, ID: 21733150

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.06.2008 at 03:39PM PDT, ID: 21733206

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628