Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Passing a single bit to a function in C18??

Status
Not open for further replies.

ste2006

Advanced Member level 4
Full Member level 1
Joined
May 1, 2012
Messages
118
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Activity points
2,226
Anyone any ideas how to pass a single bit (flag) to a function in C. I want to pass in one flag and then return another.

I know i can create a struct and access individual bits in my main program but what about functions??

Any ideas or will i have to pass a char and modify the bits with AND, OR Functions. (Was hoping to avoid this as it gets confusing to debug)

Thanks,
 

It is not possible to pass a bit.
You need to pass a byte, or a pointer to memory location.
 
Fair enough, I kind of suspected that but said i would ask the question anyway in case,

I suppose ill just pass the char in and do bit wise operations on it,

Thanks for the response though
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top