• C

extern void word(ULONG msg, BYTE target)


can you please explain to me what this line of code means? it is in a .h file.

Also, please metion (if you have something to add) about the sizes of the variables. ie: 8, 16 or 32 bit. (To give some background info, I am porting code from a 16bit to a 32 bit processor, and I need to know if this line needs to be changed.  

(Please focus on explaining the code though, then I can probably figure the rest out.

Thank you
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

extern = external. somewhere outside the current file.
void = no return value.
word = the name of the function.
ULONG = unsigned long.
msg = a ULONG variable named 'msg'
BYTE = one byte variable type.
target = a BYTE variable named 'target'

The sizes of ULONG and BTYE depends on the processor, but if you use these CONSTANT values (or use sizeof() ), you should be in the clear.

I'll look for more info also,
Arnon David.
extern void word (ULONG msg,BYTE target)

extern: Function can be used from outside this file

void: function has no return value

word: name of the function

ULONG: must be a typedef (i.g. typedef unsigned long ULONG

msg: name of the varibale of type ULONG

BYTE: typeddef like ULONG (i.g. typedef unsigned char BYTE or typedef char BYTE)

target: name of the variable of type BYTE

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
if the typedef ULONG is unsigned long no changes between 16bit and 32bit may be done. (I guess it would be so).

The same statement is true for the BYTE if char is used.
rbr, except for the 'extern' part, how is your answer different then mine ?

Arnon David.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.