Shammer's Philosophy

My private adversaria

2011-02-07から1日間の記事一覧

文字列から特定文字列を検索

ある文字列内に別の文字列が含まれているか確認し、含まれている場合はその先頭が何文字目かを返す。含まれていない場合は -1 が返される。 int match_string(const char * s, const char * x){ // check s includes x or not int base_str_length = strlen…