如果我有字符串複製從具體指數動態地使用C
char str_cp[50],str[50], str_other[50], str_type[50];
strcpy(str,"how are you : i am fine");
strcpy(str_other, "who are you : may be robot or human being");
strcpy(str_type,"type : worker/manager ");
所以如何編寫...複製從一個字符串「:」結束行的?當我不知道 結束指數。
一個好的開始可能是[找到分隔字符](http://en.cppreference.com/w/c/string/byte/strchr)。 –
「結束指數」是什麼意思?你不是一直複製到字符串的末尾嗎? – dasblinkenlight
結束索引意味着...行的最後一個字符。 –