コードはユーザー入力 (html タグ) を受け取ります
ex:
<p> The content is text only inside tag </p>
gets(str);
タスクは、すべての
オカレンスをnewline("\n")
while((ptrch=strstr(str, " ")!=NULL)
{
memcpy(ptrch, "\n", 1);
}
printf("%s", str);
上記のコードは、最初の文字のみを\n
.
ヌルポインタ('\0')で文字列を終端せずに全体を置換する方法や残りを空文字定数のようなものに設定する方法を問い合わせ
ます\n
。nbsp;