Solved

search of delimiters

Posted on 1998-03-19
5
192 Views
Last Modified: 2010-04-02
start            word         delimiters
------->0 ----------> 1   ------------->2
                     |
                 loop (search for word or digit)
STATE 0 CAN NOT VISITED IF FIRST CHARACTER
ISN'T WORD
IN THIS CASE THE FIRST CHARACTER MUST BE
A WORD.IF TRUE DO STATE 1 AND LOOK NEXT
CHARACTER UNTIL  THE STATMENT FINISHED.  
WE DOING THAT UNTIL WE FOUND IDENTIFIER
DELIMITERS THAT IN THIS CASE CHARACTER THAT
ISN'T WORD OR DIGIT(FOR EX.  ,  ; * - + / ) : ETC)


PLEASE MELP ME TO CREATE THE PROGRAM
0
Comment
Question by:lagat
5 Comments
 
LVL 11

Expert Comment

by:alexo
Comment Utility
Seems like homework.

Write a state machine.

A possible way of doing it:

Use a variable that represents the current state.
In a loop: use a SWITCH statement where each CASE represents a state's actions and transitions to other states, based on the input (getch() or similar).

Write something.  Post it here if you have problems and we'll help.
0
 
LVL 1

Expert Comment

by:Nexial
Comment Utility
And the switch statement itself should be enclosed in an input loop.

Alexo is right - post what you have done or tried and we will help.   You should at least try, especially if it is homework
0
 
LVL 2

Expert Comment

by:sprinkmeier
Comment Utility
For extra credit, do it with YACK/LEXX!
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
It looks like this might even be doable with a scanf.
But the problem statement is rather unclear to me,
If you could post the code you've written, we may be able to help
you with debugging it.
0
 
LVL 10

Accepted Solution

by:
RONSLOW earned 50 total points
Comment Utility
the C library function strtok should do what you want.

0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now