PDA

View Full Version : How do read and parse strings from stdin?


nAzGiRl2005
11-08-2005, 05:32 PM
I have written a C program for a phonebook, where I can insert into, delete from, search and print the phonebook.
I write the following commands in standard input, for "insert" for example I do:
$ i name phone_number
I need to parse this string, so I can distinguish name and phone number, in order to use them in a function that I have for insert.

insert(name, phone_number);
Is there any way I can do this?

windumi
12-07-2005, 06:03 AM
you need to learn the concept : regular expression.

REG is a most useful too for text processing