write C prgm to delete comments in in any C prgm

Status
Not open for further replies.
a simple approach would be to search for '/*' and then go on removing characters till you find a '*/' ..

its that simple ... (provided you are familiar with file handling).
 

cooldip10

In the zone
Very simple program.
Use file handling properly.

using fscanf() traverse word by word.
Check whether you encountered "/*".
if yes -> skip till you get "*/".
else -> continue copying.
 
Status
Not open for further replies.
Top Bottom