I am working on a program that is modular and alot of it's function is very procedural and repetitive. I'm sure one of you know a simple solution to this, yet it's hard to word.
Is there a way I could use this in a modular program?
#define message ( clrscr(), "\nLine1\nLine2\n%s\nLine4\n\nPress any key...")
// This needs to go somewhere "local"
printf(message, "Different Line A");
// Sub files would insert the difference
printf(message, "Different Line B");
Say I have a main source file. I then have a header file which is included into that source file. There are other header files included into the main header file. There's only 3 links. The sub headers are linked into the main header, in which the main header is linked into the main program file.
The sub headers are going to be repeating the same information with little change. With the above example of code I'm wondering how you would do that in a modular program. Would there be a way to "define" the message somewhere where every sub file could call it, then add it's change to it?