![]() |
removing comments of type // and /*
please help me in writing the code that takes a c or c++ file and deletes the comments and prints the output to other file
totally 3 files r involved one removes the comments other is the program having comments other is output printed without any comments containing c or c++ code prethanks to the helper kindly send the source code or provide link |
Re: removing comments of type // and /*
This is not a free software store. You should either
1) Attempt to write the code and ask here for help with your problems. 2) Put your request in the Job Offers forum. |
Re: removing comments of type // and /*
I can share the algo with you.
Parse the characters of the file and check for // or /* but remember that they should not be under the string literal "" Now if you find // which is not under the string literal then ignore the line if you find /* and its not in the string literal then ignore till */ Else you write everything to the new file. I hope it helps. |
| All times are GMT +5.5. The time now is 14:03. |