That's one thing they are used for. I personally use them so the code is easily modified. Say I'm reading lots of input, and I only want my program to use up so much memory. I use the following code
Code:
#define MAXLEN 512
char line1[MAXLEN];
char line2[MAXLEN];
char line3[MAXLEN];
I realize later that only having buffers of length 512 isn't enough, so I want to change them to 1024. By defining the macro MAXLEN all I need to change is the value at the top, not all of them throughout the program. I believe you can use macros to help make your programs more architecture independent using #ifndef and then check what platform you are running on (this would be at complie time, not runtime).
Macros can do different things depending on the language you're writing in. I'm moslty familiar with C, so that's what my example is in. I belive you can do a lot more "nifty" things with them in more advanced languages.