Sorry here is the perl code.
Thanks for your time#!/bin/perl5.8.6 $flag = open(file1, "main.c"); $flag2 = open(file2, ">main_out.c"); if(flag && flag2){ while(!eof(file1)){ $line = <file1>; $/ = undef; $_ = <file1>; s#(/\*.*?\*/)|//[^\n]*|("(\\.|[^"\\])*"|'(\\.|[^'\\])*'|.[^/"'\\]*)# +defined $2 ? $2 : ""#gse; print file2 ($_); } } close(file1); close(file2);
In reply to Re^6: C style multiple line comment removal
by prassi
in thread C style multiple line comment removal
by prassi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |