我試圖從給定字符的出現中斷開一個字符串。我正在使用strpbrk函數。但是,我得到這個錯誤strpbrk函數 - C
21 G:\My Programs\C\horse.cpp invalid conversion from `char' to `const char*'
,我採用的是如下
char horses[100], h[1];
char *brokenstring;
h[0] = 'H';
brokenstring = strpbrk (horses,h[0]);
我得到在我使用strpbrk函數行此錯誤的代碼。請幫助我。
1)這裏的大小爲1的char數組有什麼意義? 2)你在尋找'strchr()'嗎? – FatalError 2012-07-20 16:03:06
我認爲這段代碼必須是不完整的,你永遠不會初始化馬匹。 – Justin 2012-07-20 16:04:20
char * strpbrk(const char *,const char *) – BLUEPIXY 2012-07-20 16:05:18