Share
Explore BrainMass

C++ code to recognize comments using /* and */

I am attempting to teach myself some basic C++ programming and in working my way through a Programming Languages book, I have come across a question I am having difficulty with.

The problem is two-fold. The first is to design a state diagram to recognize one form of the comments of the C-based programming languages, those that begin with /* and end with */.

I believe I have that (attached as 4#1).

The second part of the question is to write the code to implement the state diagram.

I have attached what I have come up with (attached as 4#3). However, I am unsure what I have left out and what I need to do to define SLASH.

Attachments

$2.19