// beforebegin. CPP
// preprocessing source Program , remove comments from the file // and/* lllll */
# include
# include
# include
# include
# include
using namespace STD;
// Delete the comments in the string //
String & deletenote1 (string & SS ){
Size_t lookhere = 0;
Size_t foundhere;
Size_t secondhere;
While (foundhere = ss. Find ("//", lookhere ))! = String: NPOs ){
Secondhere = ss. Find ("/N", foundhere );
SS. Erase (foundhere, secondhere-foundhere );
Lookhere = foundhere;
}
Return SS;
}
// Delete/**/annotator from the string
String & deletenote2 (string & SS ){
Size_t lookhere = 0;
Size_t foundhere;
Size_t secondhere;
While (foundhere = ss. Find ("/*", lookhere ))! = String: NPOs ){
Secondhere = ss. Find ("*/", foundhere );
SS. Erase (foundhere, secondhere-foundhere + 2 );
Lookhere = foundhere;
}
Return SS;
}
String & beforebegin (string & SS ){
Return deletenote1 (deletenote2 (SS ));
}
int main () {
ifstream in ("wowbull. CPP ");
ostringstream OSS;
OSS // string S = OSS. STR ();
// istringstream ins (replaceall (S, "from", "to");
ofstream out ("www. CPP ");
// out out return 0;
}