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



## openSUSE (Mar 13, 2010)

Hi ....Frendz'........
       plz guide me to write this prgm.......


----------



## vandit (Mar 14, 2010)

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)

openSUSE said:


> Hi ....Frendz'........
> plz guide me to write this prgm.......



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

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

delete char; 
char ++;
}

}
delete char;
}

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


----------

