DIGIT-ARC read-only archive · snapshot: July 23, 2026

write a c prgm to delete comments in any c prgm....

3 posts · originally from https://geek.digit.in/community/threads/write-a-c-prgm-to-delete-comments-in-any-c-prgm.125063/

openSUSE
openSUSE Original post #1
Mar 13, 2010 at 12:57 PM
Hi ....Frendz'........
plz guide me to write this prgm.......:???:
vandit
vandit #2
Mar 14, 2010 at 7:46 PM
1. Just open the file in the read-write + Binary mode using the File management functions.
2. read the lines from the files (check for newline character)
3. search for double-slashes and delete them(or replace them with a space ).
jxcess3891
Mar 14, 2010 at 9:09 PM
Hi ....Frendz'........
plz guide me to write this prgm.......:???:

char = store chars of files in array;
while (!EOF){
if (char == '/*') {

while (*char++ != '/*') {

delete char; :p
char ++;
}

}
delete char;
}

This is the logic. My syntax is not good but u can work on it.