阅读背景:

比较字符串大小是比较字符的可接受替代方法吗?

来源:互联网 

I'm writing a grep function in C++ (as a self assigned exercise - I realize this doesn't have the functionality of an actual grep feature) to take an original string and the search string you are looking for. In the code, I enter all the characters in a grep string up to the first space it sees. Then I compare the characters in the grep string with the search string, and if it matches, store it in a temp string. I loop over the grep string and compare the length of the search string with the temp string to see if it matches.I'm writing a grep function in C++ (as a self a




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: