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]
Printable View
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]
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.
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".