Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ヒープ上に文字列を作成する必要があります。標準ライブラリにすでに類似したものが含まれているのでしょうか、それとも自分で実装する必要がありますか(malloc()を使用)?
malloc()、calloc()またはを使用できますstrdup()(後者はPOSIXであり、標準Cではありません)。
malloc()
calloc()
strdup()
「(を使用して)自分で実装する」とはどういう意味かは完全には明確ではありませんmalloc()。正確には何を実装する必要がありますか?