我如何设计一个简单的行解析器. [英] How can i design a simple line parser .

查看:64
本文介绍了我如何设计一个简单的行解析器.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它将解析一行并提取单词,并比较程序中预先定义的每个单词

which will parse a line and extract word and compares each word which is predifened in a program

推荐答案

您可以阅读一行,然后使用字符串函数查找话.

只需看一下标准的C库文档

http://www.gnu.org/s/libc/manual/html_node/index.html [^ ]
You can read a line and then use string functions to find the words.

Just give a look to the standard C library documentation

http://www.gnu.org/s/libc/manual/html_node/index.html[^]


您可以使用CString::Tokenizestrtok_s提取一行中的单词.
You could use CString::Tokenize or strtok_s to extract words in a line.


这篇关于我如何设计一个简单的行解析器.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆