私は次のようなコードを持っています-
Value = "Current &HT"; //this is value
void StringSet(const char * Value)
{
const char *Chk = NULL;
Chk = strpbrk(Value,"&");
if(Chk != NULL)
{
strncpy(const_cast<char *> (Chk),"&",4)
}
}
上記のコードでは、Valueの「&」を「&amp。
ここで、文字列から1文字しか置き換えられない方法を知りたいと思います。