Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

c macro

Status
Not open for further replies.

toabhilashn

Computer
Aug 13, 2003
1
how can we write a macro in C?
for eg. write a macro to do binary serch
 
Replies continue below

Recommended for you

I think you have your terminology confused. A macro is a list of directives that tells the linker to do someting such as
#define USART1_BAUDRATE(br, fosc) ((fosc)/((br)*161)-1)
it is usually some sort of value replacement and macro commands have a very limited number of commands. To do a binary search you will need to write a program (or fuction) in C itself.

Good Luck, John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor