Question: C++ - Write a main function that reads an unspecified number of lines of text from a regular text file by getting the filename from

C++ - Write a main function that reads an unspecified number of lines of text from a regular text file by getting the filename from the command line. If no filename is provided on the command line, your program should instead read its input (not a filename) from STDIN. Your program should exit on an invalid text file (name.) You may assume that no line of text will consist of more than 255 characters. Every line will contain, at most, one comment and, at most, one integer. Some lines may be blank. Comments will be contained within specific start "(*" and end "*)" delimeters, and both the start and end delimeters will always occur on the same line. Integer data may come before, or after comments if the line has both.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!