Solved

search of delimiters

Posted on 1998-03-19
5
197 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand and use pointers 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.

628 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