{"author_name":"iww","provider_name":"Hatena Blog","published":"2018-10-12 09:30:27","url":"https://iww.hateblo.jp/entry/20181012/strdup","type":"rich","height":"190","blog_url":"https://iww.hateblo.jp/","provider_url":"https://hatena.blog","width":"100%","author_url":"https://blog.hatena.ne.jp/iww/","title":" \u30e1\u30e2\u30ea\u30ea\u30fc\u30af","blog_title":"\u63ee\u767a\u6027\u306e\u30e1\u30e2\uff12","description":"strdup\u304c\u4f7f\u308f\u308c\u3066\u3044\u308b\u500b\u6240\u3067\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u304c\u8d77\u304d\u3066\u3044\u305f\u3002Man page of STRDUP Man page of BASENAME char *dirc, *basec, *bname, *dname; char *path = \"/etc/passwd\"; dirc = strdup(path); basec = strdup(path); dname = dirname(dirc); bname = basename(basec); printf(\"dirname=%s, basename=%s\\n\", dname, bname); \u307e\u3055\u306b\u3053\u308c\u305d\u306e\u307e\u307e\u306e\u30b3\u30fc\u30c9\u304c\u4f7f\u308f\u308c\u3066\u3044\u3066\u3001free\u2026","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fiww.hateblo.jp%2Fentry%2F20181012%2Fstrdup\" title=\" \u30e1\u30e2\u30ea\u30ea\u30fc\u30af - \u63ee\u767a\u6027\u306e\u30e1\u30e2\uff12\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","image_url":null,"version":"1.0","categories":["Linux"]}