www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/02/20/17:31:05

From: knakasato AT aol DOT com (KNakasato)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Utility to strip comments from C/C++ source?
Date: 20 Feb 1998 22:27:34 GMT
Lines: 32
Message-ID: <19980220222700.RAA24539@ladder02.news.aol.com>
NNTP-Posting-Host: ladder02.news.aol.com
References: <87lnv6wo4s DOT fsf AT hasn DOT dera DOT gov DOT uk>
Organization: AOL http://www.aol.com
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

In article <87lnv6wo4s DOT fsf AT hasn DOT dera DOT gov DOT uk>, Ian Miller <itmiller AT dera DOT gov DOT uk>
writes:

>
>The C preprocessor already does this. Of course, it does a bunch of other
>things too (expands macros and so on) but it's probably worth looking at.
>I suspect you can control what it does with command line switches if you
>run it by hand.
>
>Out of interest, why would you want to do this?

If compilation speed is important, minds well remove it from all
header files that don't need it, and keep as *.txt if you need it.

>Does anyone know of a utility to add comments to source files. Now that
>*would* be useful. :)

sure :-)

#include <stdio.h>

char buf[0x1000];

int main()
{
    puts("/*Copyright (C) This source is now owned by me.*/");
    while (gets(buf)) puts(buf);
    return 0;
}


Aloha

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019