Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski 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
Joined
Aug 13, 2003
Messages
1
Location
IN
how can we write a macro in C?
for eg. write a macro to do binary serch
 
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

Back
Top