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.

Explain #define SWITCH_PRESSED (bit) 1 in C

Status
Not open for further replies.

Help

Advanced Member level 2
Joined
Feb 15, 2005
Messages
617
Helped
7
Reputation
14
Reaction score
3
Trophy points
1,298
Activity points
7,065
Hi...

Anyone help me to explain this #define SWITCH_PRESSED (bit) 1??
Is it define the switch_pressed is High??

Thanks.....
 

C (#define)

Means that when you used the keywords SWITCH_PRESSED it will return a 1 or gives a one.
 

    Help

    Points: 2
    Helpful Answer Positive Rating
Re: C (#define)

#defines are just text substitutions :)

So whenever you write SWITCH_PRESSED the preprocessor will replace it with (bit) 1 before passing it to the compiler.

Simple but powerful ...

best regards
 

    Help

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top