[size=6][font=Tahoma]
[color=#333333]
i have my homework that is about file hanling...
Write a program that outputs its own C++ source file to a file called "WithoutComments.cpp" and to the screen, but omitting any of the comments enclosed in "/* ... */" markers (and omitting the markers themselves). The new program in the file "WithoutComments.cpp" should compile and run in exactly the same way as the program from which it was generated.
this is my code...
================================================
[/b][size=7]
nyl.cpp
[size=4]
<iostream>
<fstream>
<conio>
main()
{ /*every function should start with an open curly brace to indicate the starting of the func*/
char c; /*declaration of char c*/
ifstream file1; /*connects the ifstream "file1" to a following file.*/
ofstream file2;
file1.open("nyl.cpp");
file2.open("withoutcomments.cpp");
file1.get©;
while(!file1.eof()){
cout<<c;
file2.put©;
file1.get©;
}
file2.close();
file1.close();
return 0;
}
==============================================
my problem is that i could not find any built-in functions that coud omit
any statements inclosed in "/*...*/" markers....
could somebody help me with my homework???