C++去除程序注释实现

2014-11-24 12:43:40 · 作者: · 浏览: 0

\

红框中为未考虑情况

// test_max.cpp : 定义控制台应用程序的入口点。
//去除文件srcfile中的注释

#include "stdafx.h"
#include 
  
   
#include
   
     #include
    
      using namespace std; int main() { string srcfilename; string dstfilename; string temp,str,strn; int a,b; bool flag=false; srcfilename="F:\\workspace\\
     
Java
Prj\\test.cpp"; dstfilename="F:\\workspace\\JavaPrj\\test1.cpp"; strn="\n"; ifstream infile(srcfilename.c_str()); ofstream outfile(dstfilename.c_str()); cout<<"文件"<<"\""<