Solved

search of delimiters

Posted on 1998-03-19
5
194 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
ID: 1257763
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
ID: 1257764
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
ID: 1257765
For extra credit, do it with YACK/LEXX!
0
 
LVL 84

Expert Comment

by:ozo
ID: 1257766
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
ID: 1257767
the C library function strtok should do what you want.

0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
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…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

770 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