Macro Tutorial

Macro Tutorial - A Macro Tutorial and Example CS532...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
A Macro Tutorial and Example CS532 Software Engineering Spring 1998 Team Members: Mohamed Benothmane, Greg Bulla, Mike Lewis, Mike Madigan, Joe Papa, Alan Riggins. The first step in writing a macro is to examine the pseudo code or flowchart of your program for patterns of instructions that are repeated. Common uses of macros include: • Housekeeping chores, such as initializations. • Input and output operations • String handling • Conversions from one type to another, such as from ASCII to hexadecimal. • Functions specific to your program which might be represented as an in-line function in a higher level language. The user should note that macros are not a substitute for subroutines. Since the macro preprocessor substitutes the code which constitutes the body of the macro into your code, very long macros that are used many times in a program will result in enormous expansion of the code. In this case, a subroutine would be a better choice, since the code in the body of the subroutine is not inserted into your source code. In this case, flow of the program is shifted to the subroutine
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/20/2010 for the course CS 237 taught by Professor Staff during the Spring '08 term at San Diego State.

Page1 / 3

Macro Tutorial - A Macro Tutorial and Example CS532...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online