Thread: remove comments from source code

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    1

    remove comments from source code

    Hi,
    I am a newbie to c , about 4 months , I want to make a program that removes any comments from the c source code .
    I am using borland turbo c 3 , I tried but cant get it right , please help , some tips would be just great.


    [email protected]

  2. #2
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Just cuz this may be a homework assignment i'll be kind of vague about answering your question. What you need to do is make yourself a parse function. When you make it don't think only in terms of removing comments from a c file but also think of terms of making a robust function that will serve many purposes. Four months is plenty of experience to do this.

  3. #3
    the Corvetter
    Join Date
    Sep 2001
    Posts
    1,584
    Why on God's beautiful, fruitful, amazing, green earth would you want to remove comments from source code??? I'd like to see some code that PUTS comments into an unorganized and selfish programmer. Now that would be code worth glancing at.

    --Garfield

    PS And if you MUST delete comments, just work with the file through your program deleting everything that "makes it a comment".
    1978 Silver Anniversary Corvette

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to make a program that prints it's own source code???
    By chottachatri in forum C++ Programming
    Replies: 38
    Last Post: 03-28-2008, 07:06 PM
  2. Replies: 4
    Last Post: 01-18-2008, 07:05 PM
  3. Search for patterns in source code
    By MiamiCuse in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 10-23-2005, 11:28 PM
  4. DxEngine source code
    By Sang-drax in forum Game Programming
    Replies: 5
    Last Post: 06-26-2003, 05:50 PM
  5. Lines from Unix's source code have been copied into the heart of Linux????
    By zahid in forum A Brief History of Cprogramming.com
    Replies: 13
    Last Post: 05-19-2003, 03:50 PM