Solved

search of delimiters

Posted on 1998-03-19
5
195 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

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…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

830 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