http://caterpillar.onlyfun.net/Gossip/CGossip/StringCmpSearch.html

if(loc == 0) {
printf("完全匹配\n");

}
應該改成
if(loc == strlen(str1)) {
printf("完全匹配\n");
}

完全匹配的話會回傳str1的長度
新增:
        字串是程式中非常重要的一部份,C 標準函式庫中有一些函式可以協助字串的處理。
http://caterpillar.onlyfun.net/Gossip/CGossip/MallocFree.html
增加 realloc() 的說明。

http://caterpillar.onlyfun.net/Gossip/CGossip/FormatFileIO.html
增加stdin 、stdout、stderr的說明
http://caterpillar.onlyfun.net/Gossip/CGossip/PrintfScanf.html

增加scanf()的可變字元寬度說明。。。
http://caterpillar.onlyfun.net/Gossip/CGossip/PrintfScanf.html
關於掃描集的描述有誤,已修正。。XD