the following work on a sun and most other non-ANSI cpp's: #define quote(x) "x" if you're afraid that some preprocessor won't do macro substitution inside strings, try: #define quote2(x) "x #define quote(x) quote2(x") bb