Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ncar!tank!uxc!ksuvax1!vopata From: vopata@ksuvax1.cis.ksu.edu (Ed Vopata) Newsgroups: comp.lang.c Subject: Re: defining a comment? Summary: It can be done! Keywords: preprocessor,comments Message-ID: <678@ksuvax1.cis.ksu.edu> Date: 22 Sep 88 22:27:10 GMT References: <5438@techunix.BITNET> <844@vsi.UUCP> <855@vsi.UUCP> Reply-To: vopata@ksuvax1.cis.ksu.edu (Ed Vopata) Organization: Kansas State University, Dept of Computing & Information Sciences Lines: 57 In article <855@vsi.UUCP> friedl@vsi.UUCP (Stephen J. Friedl) writes: >In article <5438@techunix.BITNET>, benny@techunix.BITNET (Benny Pinkas) writes: >> >> Can I use the Preprocessor to define a comment? I mean something like: >> Yes! The following in a sample program which will demonstrate the use of STARTCOM and ENDCOM macros for defining the beginning and ending of a C Comment. Also included is the output of the preprocessor (cc -E). I have compiled this program on a couple of C compilers (one provided with 4.3 BSD and one provided by AT&T) and the program works. Please note that in the "#define STAR *" there must be only 1 space between the "STAR" and the "*" otherwise STARTCOM may look like "/ *". ------- cut here ------- #define STAR * #define STARTCOM /STAR #define ENDCOM STAR/ STARTCOM Comment.c -- by Edward Vopata (9/22/88) Put the text of the comment here. Multiple lines are allowed. ENDCOM main() { STARTCOM Some Comments within the main program ENDCOM } ------- cut here ------- The following is the ouput of the C preprocessor. % cc -E comment.c # 1 "comment.c" /* Comment.c -- by Edward Vopata (9/22/88) Put the text of the comment here. Multiple lines are allowed. */ main() { /* Some Comments within the main program */ } ---------- Name : Edward Vopata Dept. of Computing & Information Sciences Internet : vopata@ksuvax1.cis.ksu.edu Kansas State University Bitnet : vopata@ksuvax1.BITNET Manhattan, Kansas UUCP : {pyramid,ucsd}!ncr-sd!ncrwic!ksuvax1!vopata (913) 532-6350