{"id":17982,"date":"2026-07-18T11:35:55","date_gmt":"2026-07-18T02:35:55","guid":{"rendered":"https:\/\/genai-ai.co.jp\/ai-kanri\/?p=17982"},"modified":"2026-07-18T11:35:55","modified_gmt":"2026-07-18T02:35:55","slug":"cc-c-char-string","status":"publish","type":"post","link":"https:\/\/genai-ai.co.jp\/ai-kanri\/blog\/cc-c-char-string\/","title":{"rendered":"\u3010C\u8a00\u8a9echar\u578b\u5b8c\u5168\u89e3\u8aac\u3011\u6587\u5b57\u30fb\u6587\u5b57\u5217\u306e\u4f7f\u3044\u65b9\u30fbchar\u914d\u5217\u30fb\u30dd\u30a4\u30f3\u30bf\u30fb\u6587\u5b57\u5217\u95a2\u6570\u307e\u3067"},"content":{"rendered":"\n<style>\n.g-flow-row{display:flex;gap:8px;justify-content:center;flex-wrap:wrap;align-items:center;}\n.g-flow-item{background:linear-gradient(135deg,#1a1a1a,#2a1015);color:#fff;border-radius:8px;padding:16px 14px;min-width:130px;flex:1;text-align:center;}\n.g-flow-arrow{color:#dc2626;font-size:20px;font-weight:700;}\n.g-card-row{display:flex;gap:12px;flex-wrap:wrap;margin:0 0 32px;}\n.g-card-row>div{flex:1;min-width:220px;}\n@media(max-width:600px){\n  .g-flow-row{flex-direction:column;}\n  .g-flow-arrow{transform:rotate(90deg);}\n  .g-card-row{flex-direction:column;}\n  .g-card-row>div{min-width:100%;}\n}\n<\/style>\n\n\n\n<div style=\"margin:0 0 32px;\">\n  <img decoding=\"async\" src=\"\u3010C\u8a00\u8a9echar\u578b\u5b8c\u5168\u89e3\u8aac\u3011\u6587\u5b57\u30fb\u6587\u5b57\u5217\u306e\u4f7f\u3044\u65b9\u30fbchar\u914d\u5217\u30fb\u30dd\u30a4\u30f3\u30bf\u30fb\u6587\u5b57\u5217\u95a2\u6570\u307e\u3067\" alt=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/07\/thumb-cc-c-char-string.jpg\" style=\"width:100%;height:auto;border-radius:12px;display:block;\">\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">C\u8a00\u8a9e\u306echar\u578b\uff08\u6587\u5b57\u30fb\u6587\u5b57\u5217\uff09\u306e\u4f7f\u3044\u65b9\u3092\u5b8c\u5168\u89e3\u8aac\u3002char\u914d\u5217\u3068\u30dd\u30a4\u30f3\u30bf\u306e\u9055\u3044\u3001\u7d42\u7aef\u6587\u5b57\\0\u306e\u4ed5\u7d44\u307f\u3001strlen\u30fbstrcpy\u30fbstrcat\u30fbstrcmp\u306a\u3069\u306e\u6587\u5b57\u5217\u95a2\u6570\u306e\u4f7f\u3044\u65b9\u3001Claude Code\u306b\u3088\u308b\u81ea\u52d5\u751f\u6210\u307e\u3067\u5b9f\u8df5\u7684\u306b\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">C\u8a00\u8a9e\u3067\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u304f\u3068\u304d\u3001\u5fc5\u305a\u3068\u3044\u3063\u3066\u3044\u3044\u307b\u3069\u767b\u5834\u3059\u308b\u306e\u304c\u300c\u6587\u5b57\uff08char\u578b\uff09\u300d\u3068\u300c\u6587\u5b57\u5217\uff08char\u914d\u5217\uff09\u300d\u306e\u51e6\u7406\u3067\u3059\u3002C\u8a00\u8a9e\u306b\u306fString\u30af\u30e9\u30b9\u3084StringBuilder\u306e\u3088\u3046\u306a\u9ad8\u6a5f\u80fd\u306a\u6587\u5b57\u5217\u578b\u304c\u306a\u304f\u3001\u6587\u5b57\u306e\u914d\u5217\uff08char[]\uff09\u3068\u30dd\u30a4\u30f3\u30bf\uff08char*\uff09\u3092\u4f7f\u3063\u3066\u6587\u5b57\u5217\u3092\u6271\u3044\u307e\u3059\u3002\u3053\u306e\u4ed5\u7d44\u307f\u3092\u7406\u89e3\u3057\u306a\u3044\u3068C\u8a00\u8a9e\u306e\u6587\u5b57\u5217\u51e6\u7406\u306f\u6df7\u4e71\u3057\u3084\u3059\u304f\u3001\u30d0\u30b0\u306e\u6e29\u5e8a\u306b\u306a\u308a\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001char\u578b\u306e\u57fa\u672c\u304b\u3089\u59cb\u307e\u308a\u3001\u6587\u5b57\u5217\u306e\u914d\u5217\u30fb\u30dd\u30a4\u30f3\u30bf\u3067\u306e\u6271\u3044\u65b9\u3001\u6a19\u6e96\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u6587\u5b57\u5217\u95a2\u6570\u3001\u305d\u3057\u3066Claude Code\u3092\u4f7f\u3063\u305f\u81ea\u52d5\u751f\u6210\u307e\u3067\u4f53\u7cfb\u7684\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"g-flow-row\" style=\"display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:20px 0;padding:20px;background:#f8fafc;border-radius:12px;\">\n<div style=\"background:#1e3a5f;color:#fff;border-radius:8px;padding:12px 18px;font-size:14px;font-weight:600;text-align:center;min-width:120px;\">char\u578b\u306e\u57fa\u672c<\/div><div style=\"font-size:22px;color:#64748b;margin:0 6px;\">&#8594;<\/div><div style=\"background:#1e3a5f;color:#fff;border-radius:8px;padding:12px 18px;font-size:14px;font-weight:600;text-align:center;min-width:120px;\">char\u914d\u5217\uff08\u6587\u5b57\u5217\uff09<\/div><div style=\"font-size:22px;color:#64748b;margin:0 6px;\">&#8594;<\/div><div style=\"background:#1e3a5f;color:#fff;border-radius:8px;padding:12px 18px;font-size:14px;font-weight:600;text-align:center;min-width:120px;\">\u30dd\u30a4\u30f3\u30bf\u6587\u5b57\u5217<\/div><div style=\"font-size:22px;color:#64748b;margin:0 6px;\">&#8594;<\/div><div style=\"background:#1e3a5f;color:#fff;border-radius:8px;padding:12px 18px;font-size:14px;font-weight:600;text-align:center;min-width:120px;\">\u6587\u5b57\u5217\u95a2\u6570\u7fa4<\/div><div style=\"font-size:22px;color:#64748b;margin:0 6px;\">&#8594;<\/div><div style=\"background:#1e3a5f;color:#fff;border-radius:8px;padding:12px 18px;font-size:14px;font-weight:600;text-align:center;min-width:120px;\">Claude Code\u6d3b\u7528<\/div>\n<\/div>\n\n\n<div style=\"margin:48px 0 8px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap;\"><a href=\"https:\/\/aikanri.genai-ai.co.jp\/seminar2-blog\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_content=cc-c-char-string&#038;blog_slug=cc-c-char-string\" target=\"_blank\" rel=\"noopener\" aria-label=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff08\u7121\u6599\u30fb1on1\u30fb60\u5206\uff09\u306e\u4e88\u7d04\u753b\u9762\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_seminar_claude_code_2026.jpg\" alt=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff5c\u7d4c\u55b6\u8005\u30fb\u4f1a\u793e\u5f79\u54e1\u5c02\u7528 1on1 60\u5206 \u7121\u6599\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><a href=\"https:\/\/aikanri.genai-ai.co.jp\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_campaign=cc-c-char-string&#038;utm_content=h2-banner-kanri\" target=\"_blank\" rel=\"noopener\" aria-label=\"AI\u9b3c\u7ba1\u7406 \u516c\u5f0f\u30b5\u30a4\u30c8\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_blog_1to1.jpg\" alt=\"Claude Code\u3092\u7d4c\u55b6\u306b\u6d3b\u304b\u3057\u305f\u3044\u65b9\u3078 \u2014 AI\u9b3c\u7ba1\u7406\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"sec-01\">C\u8a00\u8a9e\u306echar\u578b\u3068\u306f\uff1a1\u6587\u5b57\u3092\u683c\u7d0d\u3059\u308b\u57fa\u672c\u30c7\u30fc\u30bf\u578b<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">C\u8a00\u8a9e\u306e<code>char<\/code>\u578b\u306f\u300c1\u6587\u5b57\u3092\u683c\u7d0d\u3059\u308b\u300d\u305f\u3081\u306e\u30c7\u30fc\u30bf\u578b\u3067\u3059\u3002\u6574\u6570\u578b\uff08int\uff09\u306e\u4e00\u7a2e\u3067\u3001\u6587\u5b57\u30b3\u30fc\u30c9\uff08ASCII\u5024\u306a\u3069\uff09\u3092\u6570\u5024\u3068\u3057\u3066\u4fdd\u6301\u3057\u307e\u3059\u3002\u6587\u5b57\u305d\u306e\u3082\u306e\u3067\u306f\u306a\u304f\u3001\u6587\u5b57\u306b\u5bfe\u5fdc\u3059\u308b\u6570\u5024\uff08\u6587\u5b57\u30b3\u30fc\u30c9\uff09\u304c\u5185\u90e8\u7684\u306b\u683c\u7d0d\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<div style=\"background:#f8f9fa;border-left:4px solid #6b7280;border-radius:0 8px 8px 0;padding:16px 20px;margin:20px 0;\">\n  <p style=\"margin:0 0 4px;font-size:13px;font-weight:700;color:#6b7280;letter-spacing:1px;\">&#128218; \u7528\u8a9e\u89e3\u8aac<\/p>\n  <p style=\"margin:0;font-size:15px;line-height:1.7;\"><strong>char\u578b\uff08\u30ad\u30e3\u30e9\u578b\uff09<\/strong>\uff1aC\u8a00\u8a9e\u30671\u30d0\u30a4\u30c8\uff088\u30d3\u30c3\u30c8\uff09\u306e\u30c7\u30fc\u30bf\u3092\u683c\u7d0d\u3059\u308b\u30c7\u30fc\u30bf\u578b\u3002\u6587\u5b57\u30b3\u30fc\u30c9\uff08ASCII\u7b49\uff09\u306b\u5bfe\u5fdc\u3057\u305f\u6570\u5024\u3092\u4fdd\u6301\u3057\u307e\u3059\u3002signed char\uff08-128\u301c127\uff09\u3068unsigned char\uff080\u301c255\uff09\u306e2\u7a2e\u985e\u304c\u3042\u308a\u3001\u5358\u7d14\u306b\u300cchar\u300d\u3068\u66f8\u3044\u305f\u5834\u5408\u306f\u30b3\u30f3\u30d1\u30a4\u30e9\u3084\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u306b\u3088\u3063\u3066\u3069\u3061\u3089\u306b\u306a\u308b\u304b\u7570\u306a\u308a\u307e\u3059\u3002\u6587\u5b57\u3092\u6271\u3046\u307b\u304b\u306b\u3001\u5c0f\u3055\u306a\u6574\u6570\u5024\u306e\u683c\u7d0d\u306b\u3082\u4f7f\u308f\u308c\u307e\u3059\u3002<\/p>\n<\/div>\n\n\n\n<div style=\"background:#1e1e2e;border-radius:10px;padding:20px 24px;margin:20px 0;font-family:monospace;font-size:14px;line-height:1.8;color:#cdd6f4;overflow-x:auto;white-space:pre;\"><span style=\"color:#6c7086;\">\/* char\u578b\u306e\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9 *\/<\/span>\n<span style=\"color:#89b4fa;\">#include<\/span> <span style=\"color:#a6e3a1;\">&lt;stdio.h&gt;<\/span>\n\n<span style=\"color:#cba6f7;\">int<\/span> <span style=\"color:#89b4fa;\">main<\/span>() {\n    <span style=\"color:#6c7086;\">\/* char\u578b\u30671\u6587\u5b57\u3092\u683c\u7d0d *\/<\/span>\n    <span style=\"color:#cba6f7;\">char<\/span> <span style=\"color:#89b4fa;\">c<\/span> = <span style=\"color:#a6e3a1;\">'A'<\/span>;        <span style=\"color:#6c7086;\">\/* \u30b7\u30f3\u30b0\u30eb\u30af\u30a9\u30fc\u30c8\u3067\u6587\u5b57\u3092\u6307\u5b9a *\/<\/span>\n    <span style=\"color:#cba6f7;\">char<\/span> <span style=\"color:#89b4fa;\">digit<\/span> = <span style=\"color:#a6e3a1;\">'5'<\/span>;    <span style=\"color:#6c7086;\">\/* '5'\u306f\u6570\u5b57\u306e\u6587\u5b57(ASCII 53) *\/<\/span>\n    <span style=\"color:#cba6f7;\">char<\/span> <span style=\"color:#89b4fa;\">newline<\/span> = <span style=\"color:#a6e3a1;\">'\\n'<\/span>; <span style=\"color:#6c7086;\">\/* \u6539\u884c\u6587\u5b57 *\/<\/span>\n\n    <span style=\"color:#89b4fa;\">printf<\/span>(<span style=\"color:#a6e3a1;\">\"\u6587\u5b57: %c\\n\"<\/span>, c);       <span style=\"color:#6c7086;\">\/* %c \u3067\u6587\u5b57\u3068\u3057\u3066\u51fa\u529b *\/<\/span>\n    <span style=\"color:#89b4fa;\">printf<\/span>(<span style=\"color:#a6e3a1;\">\"ASCII\u5024: %d\\n\"<\/span>, c);    <span style=\"color:#6c7086;\">\/* %d \u3067\u6570\u5024\u3068\u3057\u3066\u51fa\u529b: 65 *\/<\/span>\n\n    <span style=\"color:#6c7086;\">\/* signed\/unsigned \u306e\u9055\u3044 *\/<\/span>\n    <span style=\"color:#cba6f7;\">signed char<\/span> <span style=\"color:#89b4fa;\">sc<\/span> = -<span style=\"color:#fab387;\">128<\/span>;   <span style=\"color:#6c7086;\">\/* -128 \u301c 127 *\/<\/span>\n    <span style=\"color:#cba6f7;\">unsigned char<\/span> <span style=\"color:#89b4fa;\">uc<\/span> = <span style=\"color:#fab387;\">255<\/span>;  <span style=\"color:#6c7086;\">\/* 0 \u301c 255 *\/<\/span>\n\n    <span style=\"color:#cba6f7;\">return<\/span> <span style=\"color:#fab387;\">0<\/span>;\n}<\/div>\n\n\n\n<table style=\"width:100%;border-collapse:collapse;margin:20px 0;font-size:14px;\">\n<thead>\n<tr style=\"background:#1e3a5f;color:#fff;\">\n  <th style=\"padding:10px 14px;text-align:left;border:1px solid #cbd5e1;\">\u578b<\/th>\n  <th style=\"padding:10px 14px;text-align:left;border:1px solid #cbd5e1;\">\u30b5\u30a4\u30ba<\/th>\n  <th style=\"padding:10px 14px;text-align:left;border:1px solid #cbd5e1;\">\u5024\u306e\u7bc4\u56f2<\/th>\n  <th style=\"padding:10px 14px;text-align:left;border:1px solid #cbd5e1;\">\u7528\u9014<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"background:#fff;\">\n  <td style=\"padding:9px 14px;border:1px solid #cbd5e1;font-family:monospace;color:#dc2626;\">char<\/td>\n  <td style=\"padding:9px 14px;border:1px solid #cbd5e1;\">1\u30d0\u30a4\u30c8<\/td>\n  <td style=\"padding:9px 14px;border:1px solid #cbd5e1;\">\u74b0\u5883\u4f9d\u5b58\uff08-128\u301c127 or 0\u301c255\uff09<\/td>\n  <td style=\"padding:9px 14px;border:1px solid #cbd5e1;\">\u6587\u5b57\u51e6\u7406\u30fb\u6587\u5b57\u5217<\/td>\n<\/tr>\n<tr style=\"background:#f8fafc;\">\n  <td style=\"padding:9px 14px;border:1px solid #cbd5e1;font-family:monospace;color:#dc2626;\">signed char<\/td>\n  <td style=\"padding:9px 14px;border:1px solid #cbd5e1;\">1\u30d0\u30a4\u30c8<\/td>\n  <td style=\"padding:9px 14px;border:1px solid #cbd5e1;\">-128 \u301c 127<\/td>\n  <td style=\"padding:9px 14px;border:1px solid #cbd5e1;\">\u7b26\u53f7\u4ed8\u304d\u5c0f\u6574\u6570<\/td>\n<\/tr>\n<tr style=\"background:#fff;\">\n  <td style=\"padding:9px 14px;border:1px solid #cbd5e1;font-family:monospace;color:#dc2626;\">unsigned char<\/td>\n  <td style=\"padding:9px 14px;border:1px solid #cbd5e1;\">1\u30d0\u30a4\u30c8<\/td>\n  <td style=\"padding:9px 14px;border:1px solid #cbd5e1;\">0 \u301c 255<\/td>\n  <td style=\"padding:9px 14px;border:1px solid #cbd5e1;\">\u30d0\u30a4\u30c8\u30c7\u30fc\u30bf\u30fb\u30d0\u30a4\u30ca\u30ea\u51e6\u7406<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\n\n\n<div style=\"background:#fff5f5;border-left:4px solid #ef4444;border-radius:0 8px 8px 0;padding:16px 20px;margin:20px 0;\">\n  <p style=\"margin:0 0 4px;font-size:13px;font-weight:700;color:#ef4444;letter-spacing:1px;\">&#9888;&#65039; \u65e5\u672c\u8a9e\uff08\u5168\u89d2\u6587\u5b57\uff09\u306fchar\u578b1\u3064\u3067\u306f\u683c\u7d0d\u3067\u304d\u306a\u3044<\/p>\n  <p style=\"margin:0;font-size:15px;line-height:1.7;\">char\u578b\u306f1\u30d0\u30a4\u30c8\uff080\u301c255\u306e\u7bc4\u56f2\uff09\u3057\u304b\u683c\u7d0d\u3067\u304d\u307e\u305b\u3093\u3002\u65e5\u672c\u8a9e\u306e\u5168\u89d2\u6587\u5b57\u306f\u901a\u5e382\u30d0\u30a4\u30c8\u307e\u305f\u306f3\u301c4\u30d0\u30a4\u30c8\uff08UTF-8\uff09\u5fc5\u8981\u306a\u305f\u3081\u3001char\u578b1\u3064\u3067\u306f\u8868\u73fe\u3067\u304d\u307e\u305b\u3093\u3002\u65e5\u672c\u8a9e\u6587\u5b57\u5217\u3092\u6271\u3046\u5834\u5408\u306fchar\u914d\u5217\u306b\u8907\u6570\u30d0\u30a4\u30c8\u3068\u3057\u3066\u683c\u7d0d\u3057\u3001\u51e6\u7406\u306b\u306f\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u5bfe\u5fdc\u306e\u95a2\u6570\uff08mbstowcs\u7b49\uff09\u3092\u4f7f\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<\/div>\n\n\n<div style=\"margin:48px 0 8px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap;\"><a href=\"https:\/\/aikanri.genai-ai.co.jp\/seminar2-blog\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_content=cc-c-char-string&#038;blog_slug=cc-c-char-string\" target=\"_blank\" rel=\"noopener\" aria-label=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff08\u7121\u6599\u30fb1on1\u30fb60\u5206\uff09\u306e\u4e88\u7d04\u753b\u9762\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_seminar_claude_code_2026.jpg\" alt=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff5c\u7d4c\u55b6\u8005\u30fb\u4f1a\u793e\u5f79\u54e1\u5c02\u7528 1on1 60\u5206 \u7121\u6599\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><a href=\"https:\/\/aikanri.genai-ai.co.jp\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_campaign=cc-c-char-string&#038;utm_content=h2-banner-kanri\" target=\"_blank\" rel=\"noopener\" aria-label=\"AI\u9b3c\u7ba1\u7406 \u516c\u5f0f\u30b5\u30a4\u30c8\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_blog_1to1.jpg\" alt=\"Claude Code\u3092\u7d4c\u55b6\u306b\u6d3b\u304b\u3057\u305f\u3044\u65b9\u3078 \u2014 AI\u9b3c\u7ba1\u7406\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"sec-02\">char\u914d\u5217\u3067\u6587\u5b57\u5217\u3092\u6271\u3046\uff1a\u5ba3\u8a00\u30fb\u521d\u671f\u5316\u30fb\u7d42\u7aef\u6587\u5b57\u306e\u4ed5\u7d44\u307f<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">C\u8a00\u8a9e\u306b\u306f\u300c\u6587\u5b57\u5217\u578b\u300d\u304c\u3042\u308a\u307e\u305b\u3093\u3002\u6587\u5b57\u5217\u306f<code>char<\/code>\u578b\u306e\u914d\u5217\uff08char[]\uff09\u3067\u8868\u73fe\u3057\u307e\u3059\u3002\u6587\u5b57\u5217\u30ea\u30c6\u30e9\u30eb\uff08\"Hello\"\u7b49\uff09\u3092\u5909\u6570\u306b\u683c\u7d0d\u3059\u308b\u306b\u306f\u3001\u5341\u5206\u306a\u30b5\u30a4\u30ba\u306echar\u914d\u5217\u3092\u5ba3\u8a00\u3057\u3001\u305d\u306e\u914d\u5217\u306b\u6587\u5b57\u3092\u4e26\u3079\u307e\u3059\u3002<\/p>\n\n\n\n<div style=\"background:#f8f9fa;border-left:4px solid #6b7280;border-radius:0 8px 8px 0;padding:16px 20px;margin:20px 0;\">\n  <p style=\"margin:0 0 4px;font-size:13px;font-weight:700;color:#6b7280;letter-spacing:1px;\">&#128218; \u7528\u8a9e\u89e3\u8aac<\/p>\n  <p style=\"margin:0;font-size:15px;line-height:1.7;\"><strong>\u7d42\u7aef\u6587\u5b57\uff08\u30cc\u30eb\u6587\u5b57\u30fb\\0\uff09<\/strong>\uff1aC\u8a00\u8a9e\u306e\u6587\u5b57\u5217\u306e\u672b\u5c3e\u306b\u81ea\u52d5\u7684\u306b\u4ed8\u52a0\u3055\u308c\u308b\u7279\u6b8a\u6587\u5b57\u3067\u3001\u6587\u5b57\u30b3\u30fc\u30c9\u304c0\uff08\u30bc\u30ed\uff09\u306e\u30d0\u30a4\u30c8\u3067\u3059\u3002\u300c\\0\u300d\u3084\u300cNULL\u6587\u5b57\u300d\u3068\u3082\u547c\u3070\u308c\u307e\u3059\u3002\u6587\u5b57\u5217\u95a2\u6570\uff08strlen\u30fbstrcpy\u7b49\uff09\u306f\u3053\u306e\u7d42\u7aef\u6587\u5b57\u3092\u76ee\u5370\u3068\u3057\u3066\u6587\u5b57\u5217\u306e\u7d42\u308f\u308a\u3092\u5224\u5b9a\u3057\u307e\u3059\u3002char\u914d\u5217\u306e\u30b5\u30a4\u30ba\u306f\u300c\u6587\u5b57\u6570+1\uff08\u7d42\u7aef\u6587\u5b57\u5206\uff09\u300d\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<\/div>\n\n\n\n<div style=\"background:#1e1e2e;border-radius:10px;padding:20px 24px;margin:20px 0;font-family:monospace;font-size:14px;line-height:1.8;color:#cdd6f4;overflow-x:auto;white-space:pre;\"><span style=\"color:#89b4fa;\">#include<\/span> <span style=\"color:#a6e3a1;\">&lt;stdio.h&gt;<\/span>\n\n<span style=\"color:#cba6f7;\">int<\/span> <span style=\"color:#89b4fa;\">main<\/span>() {\n    <span style=\"color:#6c7086;\">\/* \u6587\u5b57\u5217\u306e\u5ba3\u8a00\u3068\u521d\u671f\u5316\uff08\u30b5\u30a4\u30ba\u306f\u6587\u5b57\u6570+1\u304c\u5fc5\u8981\uff09*\/<\/span>\n    <span style=\"color:#cba6f7;\">char<\/span> <span style=\"color:#89b4fa;\">str1<\/span>[<span style=\"color:#fab387;\">6<\/span>] = <span style=\"color:#a6e3a1;\">\"Hello\"<\/span>;  <span style=\"color:#6c7086;\">\/* 5\u6587\u5b57+\u7d42\u7aef\u6587\u5b57\\0\u30676\u30d0\u30a4\u30c8 *\/<\/span>\n    <span style=\"color:#cba6f7;\">char<\/span> <span style=\"color:#89b4fa;\">str2<\/span>[] = <span style=\"color:#a6e3a1;\">\"World\"<\/span>;   <span style=\"color:#6c7086;\">\/* \u30b5\u30a4\u30ba\u7701\u7565: \u30b3\u30f3\u30d1\u30a4\u30e9\u304c\u81ea\u52d5\u8a08\u7b97 *\/<\/span>\n\n    <span style=\"color:#89b4fa;\">printf<\/span>(<span style=\"color:#a6e3a1;\">\"%s\\n\"<\/span>, str1);   <span style=\"color:#6c7086;\">\/* %s \u3067\u6587\u5b57\u5217\u3068\u3057\u3066\u51fa\u529b *\/<\/span>\n    <span style=\"color:#89b4fa;\">printf<\/span>(<span style=\"color:#a6e3a1;\">\"%s\\n\"<\/span>, str2);\n\n    <span style=\"color:#6c7086;\">\/* \u914d\u5217\u306e\u4e2d\u8eab\u3092\u78ba\u8a8d *\/<\/span>\n    <span style=\"color:#cba6f7;\">int<\/span> <span style=\"color:#89b4fa;\">i<\/span>;\n    <span style=\"color:#cba6f7;\">for<\/span> (<span style=\"color:#89b4fa;\">i<\/span> = <span style=\"color:#fab387;\">0<\/span>; <span style=\"color:#89b4fa;\">i<\/span> &lt; <span style=\"color:#fab387;\">6<\/span>; <span style=\"color:#89b4fa;\">i<\/span>++) {\n        <span style=\"color:#89b4fa;\">printf<\/span>(<span style=\"color:#a6e3a1;\">\"str1[%d] = %c (ASCII: %d)\\n\"<\/span>, <span style=\"color:#89b4fa;\">i<\/span>, str1[<span style=\"color:#89b4fa;\">i<\/span>], str1[<span style=\"color:#89b4fa;\">i<\/span>]);\n    }\n    <span style=\"color:#6c7086;\">\/* \u51fa\u529b:\n       str1[0] = H (ASCII: 72)\n       str1[1] = e (ASCII: 101)\n       ...\n       str1[5] = (NULL) (ASCII: 0)  \u2190 \u7d42\u7aef\u6587\u5b57 *\/<\/span>\n\n    <span style=\"color:#6c7086;\">\/* \u6587\u5b57\u5217\u306e\u500b\u5225\u6587\u5b57\u30a2\u30af\u30bb\u30b9 *\/<\/span>\n    str1[<span style=\"color:#fab387;\">0<\/span>] = <span style=\"color:#a6e3a1;\">'h'<\/span>;  <span style=\"color:#6c7086;\">\/* \u5148\u982d\u6587\u5b57\u3092\u5c0f\u6587\u5b57\u306b\u5909\u66f4 *\/<\/span>\n    <span style=\"color:#89b4fa;\">printf<\/span>(<span style=\"color:#a6e3a1;\">\"%s\\n\"<\/span>, str1);  <span style=\"color:#6c7086;\">\/* \"hello\" *\/<\/span>\n\n    <span style=\"color:#cba6f7;\">return<\/span> <span style=\"color:#fab387;\">0<\/span>;\n}<\/div>\n\n\n\n<div style=\"background:#f0fdf4;border-left:4px solid #22c55e;border-radius:0 8px 8px 0;padding:16px 20px;margin:20px 0;\">\n  <p style=\"margin:0 0 4px;font-size:13px;font-weight:700;color:#22c55e;letter-spacing:1px;\">&#128161; \u30b5\u30a4\u30ba\u7701\u7565\u306e\u521d\u671f\u5316\u304c\u5b9f\u7528\u7684<\/p>\n  <p style=\"margin:0;font-size:15px;line-height:1.7;\">char str[] = \"Hello\";\u306e\u3088\u3046\u306b\u30b5\u30a4\u30ba\u3092\u7701\u7565\u3059\u308b\u3068\u3001\u30b3\u30f3\u30d1\u30a4\u30e9\u304c\u6587\u5b57\u5217\u306e\u9577\u3055\uff08\u7d42\u7aef\u6587\u5b57\u542b\u3080\uff09\u3092\u81ea\u52d5\u8a08\u7b97\u3057\u3066\u30b5\u30a4\u30ba\u3092\u6c7a\u5b9a\u3057\u307e\u3059\u3002\u56fa\u5b9a\u9577\u3067\u5ba3\u8a00\u3059\u308b\u3068\u30b5\u30a4\u30ba\u3092\u9593\u9055\u3048\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u305f\u3081\u3001\u521d\u671f\u5024\u304c\u6c7a\u307e\u3063\u3066\u3044\u308b\u5834\u5408\u306f\u30b5\u30a4\u30ba\u7701\u7565\u5f62\u304c\u5b89\u5168\u3067\u30b3\u30fc\u30c9\u3082\u8aad\u307f\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<\/div>\n\n\n<div style=\"margin:48px 0 8px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap;\"><a href=\"https:\/\/aikanri.genai-ai.co.jp\/seminar2-blog\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_content=cc-c-char-string&#038;blog_slug=cc-c-char-string\" target=\"_blank\" rel=\"noopener\" aria-label=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff08\u7121\u6599\u30fb1on1\u30fb60\u5206\uff09\u306e\u4e88\u7d04\u753b\u9762\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_seminar_claude_code_2026.jpg\" alt=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff5c\u7d4c\u55b6\u8005\u30fb\u4f1a\u793e\u5f79\u54e1\u5c02\u7528 1on1 60\u5206 \u7121\u6599\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><a href=\"https:\/\/aikanri.genai-ai.co.jp\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_campaign=cc-c-char-string&#038;utm_content=h2-banner-kanri\" target=\"_blank\" rel=\"noopener\" aria-label=\"AI\u9b3c\u7ba1\u7406 \u516c\u5f0f\u30b5\u30a4\u30c8\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_blog_1to1.jpg\" alt=\"Claude Code\u3092\u7d4c\u55b6\u306b\u6d3b\u304b\u3057\u305f\u3044\u65b9\u3078 \u2014 AI\u9b3c\u7ba1\u7406\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"sec-03\">char*\uff08\u6587\u5b57\u5217\u30dd\u30a4\u30f3\u30bf\uff09\u306e\u4f7f\u3044\u65b9\uff1a\u914d\u5217\u3068\u306e\u9055\u3044\u3068\u6ce8\u610f\u70b9<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">C\u8a00\u8a9e\u3067\u306f\u6587\u5b57\u5217\u3092char\u914d\u5217\u3060\u3051\u3067\u306a\u304f\u3001<code>char*<\/code>\uff08char\u30dd\u30a4\u30f3\u30bf\uff09\u3092\u4f7f\u3063\u3066\u6271\u3046\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002\u30dd\u30a4\u30f3\u30bf\u306b\u3088\u308b\u6587\u5b57\u5217\u3068\u914d\u5217\u306b\u3088\u308b\u6587\u5b57\u5217\u306f\u4f3c\u3066\u3044\u308b\u3088\u3046\u3067\u91cd\u8981\u306a\u9055\u3044\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<div style=\"background:#f8f9fa;border-left:4px solid #6b7280;border-radius:0 8px 8px 0;padding:16px 20px;margin:20px 0;\">\n  <p style=\"margin:0 0 4px;font-size:13px;font-weight:700;color:#6b7280;letter-spacing:1px;\">&#128218; \u7528\u8a9e\u89e3\u8aac<\/p>\n  <p style=\"margin:0;font-size:15px;line-height:1.7;\"><strong>char*\uff08char\u30dd\u30a4\u30f3\u30bf\uff09<\/strong>\uff1achar\u578b\u306e\u30c7\u30fc\u30bf\u304c\u5b58\u5728\u3059\u308b\u30e1\u30e2\u30ea\u306e\u30a2\u30c9\u30ec\u30b9\u3092\u683c\u7d0d\u3059\u308b\u5909\u6570\u3002\u300cchar *p = \"Hello\";\u300d\u3068\u66f8\u304f\u3068\u3001\u6587\u5b57\u5217\u30ea\u30c6\u30e9\u30eb\"Hello\"\u304c\u683c\u7d0d\u3055\u308c\u3066\u3044\u308b\u30e1\u30e2\u30ea\u306e\u30a2\u30c9\u30ec\u30b9\u3092p\u304c\u6307\u3057\u307e\u3059\u3002\u914d\u5217\u3068\u9055\u3044\u3001\u30dd\u30a4\u30f3\u30bf\u5909\u6570\u81ea\u4f53\u306e\u30b5\u30a4\u30ba\u306f\u30a2\u30c9\u30ec\u30b9\u306e\u30b5\u30a4\u30ba\uff0832bit\u74b0\u5883\u30674\u30d0\u30a4\u30c8\u300164bit\u74b0\u5883\u30678\u30d0\u30a4\u30c8\uff09\u3067\u3059\u3002<\/p>\n<\/div>\n\n\n\n<div style=\"background:#1e1e2e;border-radius:10px;padding:20px 24px;margin:20px 0;font-family:monospace;font-size:14px;line-height:1.8;color:#cdd6f4;overflow-x:auto;white-space:pre;\"><span style=\"color:#89b4fa;\">#include<\/span> <span style=\"color:#a6e3a1;\">&lt;stdio.h&gt;<\/span>\n\n<span style=\"color:#cba6f7;\">int<\/span> <span style=\"color:#89b4fa;\">main<\/span>() {\n    <span style=\"color:#6c7086;\">\/* char\u914d\u5217 vs char\u30dd\u30a4\u30f3\u30bf *\/<\/span>\n    <span style=\"color:#cba6f7;\">char<\/span> <span style=\"color:#89b4fa;\">arr<\/span>[] = <span style=\"color:#a6e3a1;\">\"Hello\"<\/span>;   <span style=\"color:#6c7086;\">\/* \u914d\u5217: \u30b9\u30bf\u30c3\u30af\u306b\u6587\u5b57\u30c7\u30fc\u30bf\u3092\u683c\u7d0d *\/<\/span>\n    <span style=\"color:#cba6f7;\">char<\/span> *<span style=\"color:#89b4fa;\">ptr<\/span> = <span style=\"color:#a6e3a1;\">\"Hello\"<\/span>;   <span style=\"color:#6c7086;\">\/* \u30dd\u30a4\u30f3\u30bf: \u6587\u5b57\u5217\u30ea\u30c6\u30e9\u30eb\u306e\u30a2\u30c9\u30ec\u30b9\u3092\u683c\u7d0d *\/<\/span>\n\n    <span style=\"color:#89b4fa;\">printf<\/span>(<span style=\"color:#a6e3a1;\">\"\u914d\u5217: %s\\n\"<\/span>, arr);\n    <span style=\"color:#89b4fa;\">printf<\/span>(<span style=\"color:#a6e3a1;\">\"\u30dd\u30a4\u30f3\u30bf: %s\\n\"<\/span>, ptr);\n\n    <span style=\"color:#6c7086;\">\/* \u914d\u5217\u306fsizeof()\u3067\u6587\u5b57\u5217\u9577+1\u304c\u53d6\u5f97\u3067\u304d\u308b *\/<\/span>\n    <span style=\"color:#89b4fa;\">printf<\/span>(<span style=\"color:#a6e3a1;\">\"arr sizeof: %zu\\n\"<\/span>, <span style=\"color:#89b4fa;\">sizeof<\/span>(arr));   <span style=\"color:#6c7086;\">\/* 6 (5\u6587\u5b57+\\0) *\/<\/span>\n    <span style=\"color:#89b4fa;\">printf<\/span>(<span style=\"color:#a6e3a1;\">\"ptr sizeof: %zu\\n\"<\/span>, <span style=\"color:#89b4fa;\">sizeof<\/span>(ptr));   <span style=\"color:#6c7086;\">\/* 4 or 8 (\u30dd\u30a4\u30f3\u30bf\u30b5\u30a4\u30ba) *\/<\/span>\n\n    <span style=\"color:#6c7086;\">\/* \u914d\u5217\u306e\u5404\u8981\u7d20\u306f\u66f8\u304d\u63db\u3048\u3089\u308c\u308b *\/<\/span>\n    arr[<span style=\"color:#fab387;\">0<\/span>] = <span style=\"color:#a6e3a1;\">'h'<\/span>;  <span style=\"color:#6c7086;\">\/* OK: \u914d\u5217\u306f\u66f8\u304d\u63db\u3048\u53ef\u80fd *\/<\/span>\n\n    <span style=\"color:#6c7086;\">\/* \u6587\u5b57\u5217\u30ea\u30c6\u30e9\u30eb\u3078\u306e\u30dd\u30a4\u30f3\u30bf\u306f\u66f8\u304d\u63db\u3048\u4e0d\u53ef *\/<\/span>\n    <span style=\"color:#6c7086;\">\/* ptr[0] = 'h';  *\/<\/span>  <span style=\"color:#6c7086;\">\/* \u5371\u967a: \u672a\u5b9a\u7fa9\u52d5\u4f5c\uff08\u30bb\u30b0\u30e1\u30f3\u30c6\u30fc\u30b7\u30e7\u30f3\u9055\u53cd\uff09 *\/<\/span>\n\n    <span style=\"color:#cba6f7;\">return<\/span> <span style=\"color:#fab387;\">0<\/span>;\n}<\/div>\n\n\n\n<table style=\"width:100%;border-collapse:collapse;margin:20px 0;font-size:14px;\">\n<thead>\n<tr style=\"background:#1e3a5f;color:#fff;\">\n  <th style=\"padding:10px 14px;text-align:left;border:1px solid #cbd5e1;\">\u6bd4\u8f03\u9805\u76ee<\/th>\n  <th style=\"padding:10px 14px;text-align:left;border:1px solid #cbd5e1;\">char\u914d\u5217\uff08char[]\uff09<\/th>\n  <th style=\"padding:10px 14px;text-align:left;border:1px solid #cbd5e1;\">char\u30dd\u30a4\u30f3\u30bf\uff08char*\uff09<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"background:#fff;\">\n  <td style=\"padding:9px 14px;border:1px solid #cbd5e1;\">\u30e1\u30e2\u30ea\u306e\u4f4d\u7f6e<\/td>\n  <td style=\"padding:9px 14px;border:1px solid #cbd5e1;\">\u30b9\u30bf\u30c3\u30af\uff08\u30ed\u30fc\u30ab\u30eb\uff09<\/td>\n  <td style=\"padding:9px 14px;border:1px solid #cbd5e1;\">\u30c7\u30fc\u30bf\u30bb\u30b0\u30e1\u30f3\u30c8\uff08\u30ea\u30c6\u30e9\u30eb\uff09<\/td>\n<\/tr>\n<tr style=\"background:#f8fafc;\">\n  <td style=\"padding:9px 14px;border:1px solid #cbd5e1;\">sizeof()\u306e\u7d50\u679c<\/td>\n  <td style=\"padding:9px 14px;border:1px solid #cbd5e1;\">\u6587\u5b57\u5217\u9577+1\uff08\u30d0\u30a4\u30c8\u6570\uff09<\/td>\n  <td style=\"padding:9px 14px;border:1px solid #cbd5e1;\">\u30dd\u30a4\u30f3\u30bf\u306e\u30b5\u30a4\u30ba\uff084 or 8\uff09<\/td>\n<\/tr>\n<tr style=\"background:#fff;\">\n  <td style=\"padding:9px 14px;border:1px solid #cbd5e1;\">\u5185\u5bb9\u306e\u66f8\u304d\u63db\u3048<\/td>\n  <td style=\"padding:9px 14px;border:1px solid #cbd5e1;\">\u53ef\u80fd\uff08arr[0] = 'x'\uff09<\/td>\n  <td style=\"padding:9px 14px;border:1px solid #cbd5e1;\">\u30ea\u30c6\u30e9\u30eb\u6307\u5b9a\u6642\u306f\u4e0d\u53ef\uff08UB\uff09<\/td>\n<\/tr>\n<tr style=\"background:#f8fafc;\">\n  <td style=\"padding:9px 14px;border:1px solid #cbd5e1;\">\u30dd\u30a4\u30f3\u30bf\u306e\u30ea\u30bb\u30c3\u30c8<\/td>\n  <td style=\"padding:9px 14px;border:1px solid #cbd5e1;\">\u4e0d\u53ef\uff08\u914d\u5217\u540d\u306f\u5b9a\u6570\u30dd\u30a4\u30f3\u30bf\uff09<\/td>\n  <td style=\"padding:9px 14px;border:1px solid #cbd5e1;\">\u53ef\u80fd\uff08ptr = \"other\"\uff09<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\n\n\n<div style=\"background:#fff5f5;border-left:4px solid #ef4444;border-radius:0 8px 8px 0;padding:16px 20px;margin:20px 0;\">\n  <p style=\"margin:0 0 4px;font-size:13px;font-weight:700;color:#ef4444;letter-spacing:1px;\">&#9888;&#65039; char*\u30ea\u30c6\u30e9\u30eb\u306e\u66f8\u304d\u63db\u3048\u306f\u672a\u5b9a\u7fa9\u52d5\u4f5c<\/p>\n  <p style=\"margin:0;font-size:15px;line-height:1.7;\">\u300cchar *p = \"Hello\"; p[0] = 'h';\u300d\u306f\u6587\u5b57\u5217\u30ea\u30c6\u30e9\u30eb\u304c\u683c\u7d0d\u3055\u308c\u3066\u3044\u308b\u8aad\u307f\u53d6\u308a\u5c02\u7528\u30e1\u30e2\u30ea\u3092\u66f8\u304d\u63db\u3048\u3088\u3046\u3068\u3059\u308b\u305f\u3081\u3001\u30bb\u30b0\u30e1\u30f3\u30c6\u30fc\u30b7\u30e7\u30f3\u9055\u53cd\uff08Segmentation fault\uff09\u304c\u8d77\u304d\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002\u6587\u5b57\u5217\u306e\u5185\u5bb9\u3092\u66f8\u304d\u63db\u3048\u305f\u3044\u5834\u5408\u306fchar[]\u914d\u5217\u3092\u4f7f\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<\/div>\n\n\n<div style=\"margin:48px 0 8px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap;\"><a href=\"https:\/\/aikanri.genai-ai.co.jp\/seminar2-blog\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_content=cc-c-char-string&#038;blog_slug=cc-c-char-string\" target=\"_blank\" rel=\"noopener\" aria-label=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff08\u7121\u6599\u30fb1on1\u30fb60\u5206\uff09\u306e\u4e88\u7d04\u753b\u9762\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_seminar_claude_code_2026.jpg\" alt=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff5c\u7d4c\u55b6\u8005\u30fb\u4f1a\u793e\u5f79\u54e1\u5c02\u7528 1on1 60\u5206 \u7121\u6599\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><a href=\"https:\/\/aikanri.genai-ai.co.jp\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_campaign=cc-c-char-string&#038;utm_content=h2-banner-kanri\" target=\"_blank\" rel=\"noopener\" aria-label=\"AI\u9b3c\u7ba1\u7406 \u516c\u5f0f\u30b5\u30a4\u30c8\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_blog_1to1.jpg\" alt=\"Claude Code\u3092\u7d4c\u55b6\u306b\u6d3b\u304b\u3057\u305f\u3044\u65b9\u3078 \u2014 AI\u9b3c\u7ba1\u7406\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"sec-04\">C\u8a00\u8a9e\u306e\u6587\u5b57\u5217\u95a2\u6570\uff1astrlen\u30fbstrcpy\u30fbstrcat\u30fbstrcmp\u306e\u4f7f\u3044\u65b9<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">C\u8a00\u8a9e\u306b\u306f\u6587\u5b57\u5217\u3092\u64cd\u4f5c\u3059\u308b\u305f\u3081\u306e\u6a19\u6e96\u30e9\u30a4\u30d6\u30e9\u30ea\u95a2\u6570\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u3089\u306f<code>string.h<\/code>\u3092\u30a4\u30f3\u30af\u30eb\u30fc\u30c9\u3057\u3066\u4f7f\u3044\u307e\u3059\u3002\u3088\u304f\u4f7f\u30464\u3064\u306e\u95a2\u6570\u3092\u8a73\u3057\u304f\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div style=\"background:#f8f9fa;border-left:4px solid #6b7280;border-radius:0 8px 8px 0;padding:16px 20px;margin:20px 0;\">\n  <p style=\"margin:0 0 4px;font-size:13px;font-weight:700;color:#6b7280;letter-spacing:1px;\">&#128218; \u7528\u8a9e\u89e3\u8aac<\/p>\n  <p style=\"margin:0;font-size:15px;line-height:1.7;\"><strong>string.h\uff08\u30b9\u30c8\u30ea\u30f3\u30b0\u30a8\u30a4\u30c1\uff09<\/strong>\uff1aC\u8a00\u8a9e\u306e\u6a19\u6e96\u30e9\u30a4\u30d6\u30e9\u30ea\u30d8\u30c3\u30c0\u30d5\u30a1\u30a4\u30eb\u306e\u4e00\u3064\u3002strlen\u30fbstrcpy\u30fbstrcat\u30fbstrcmp\u306a\u3069\u306e\u6587\u5b57\u5217\u64cd\u4f5c\u95a2\u6570\u306e\u30d7\u30ed\u30c8\u30bf\u30a4\u30d7\u5ba3\u8a00\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002\u6587\u5b57\u5217\u95a2\u6570\u3092\u4f7f\u3046\u969b\u306f\u5fc5\u305a\u300c#include &lt;string.h&gt;\u300d\u3092\u8a18\u8ff0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<\/div>\n\n\n\n<div class=\"g-flow-row\" style=\"display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:20px 0;padding:20px;background:#f8fafc;border-radius:12px;\">\n<div style=\"background:#1e3a5f;color:#fff;border-radius:8px;padding:12px 18px;font-size:14px;font-weight:600;text-align:center;min-width:120px;\">strlen\uff08\u9577\u3055\u53d6\u5f97\uff09<\/div><div style=\"font-size:22px;color:#64748b;margin:0 6px;\">&#8594;<\/div><div style=\"background:#1e3a5f;color:#fff;border-radius:8px;padding:12px 18px;font-size:14px;font-weight:600;text-align:center;min-width:120px;\">strcpy\uff08\u30b3\u30d4\u30fc\uff09<\/div><div style=\"font-size:22px;color:#64748b;margin:0 6px;\">&#8594;<\/div><div style=\"background:#1e3a5f;color:#fff;border-radius:8px;padding:12px 18px;font-size:14px;font-weight:600;text-align:center;min-width:120px;\">strcat\uff08\u9023\u7d50\uff09<\/div><div style=\"font-size:22px;color:#64748b;margin:0 6px;\">&#8594;<\/div><div style=\"background:#1e3a5f;color:#fff;border-radius:8px;padding:12px 18px;font-size:14px;font-weight:600;text-align:center;min-width:120px;\">strcmp\uff08\u6bd4\u8f03\uff09<\/div>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">strlen\uff1a\u6587\u5b57\u5217\u306e\u9577\u3055\u3092\u53d6\u5f97\u3059\u308b<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>strlen<\/code>\u306f\u6587\u5b57\u5217\u306e\u9577\u3055\uff08\u7d42\u7aef\u6587\u5b57\u3092\u9664\u3044\u305f\u6587\u5b57\u6570\uff09\u3092\u8fd4\u3057\u307e\u3059\u3002strlen\u95a2\u6570\u306f\u7d42\u7aef\u6587\u5b57\uff08\\0\uff09\u3092\u898b\u3064\u3051\u308b\u307e\u3067\u306e\u6587\u5b57\u6570\u3092\u6570\u3048\u308b\u305f\u3081\u3001\u914d\u5217\u306e\u30b5\u30a4\u30ba\u3067\u306f\u306a\u304f\u5b9f\u969b\u306e\u6587\u5b57\u5217\u9577\u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div style=\"background:#1e1e2e;border-radius:10px;padding:20px 24px;margin:20px 0;font-family:monospace;font-size:14px;line-height:1.8;color:#cdd6f4;overflow-x:auto;white-space:pre;\"><span style=\"color:#89b4fa;\">#include<\/span> <span style=\"color:#a6e3a1;\">&lt;stdio.h&gt;<\/span>\n<span style=\"color:#89b4fa;\">#include<\/span> <span style=\"color:#a6e3a1;\">&lt;string.h&gt;<\/span>\n\n<span style=\"color:#cba6f7;\">int<\/span> <span style=\"color:#89b4fa;\">main<\/span>() {\n    <span style=\"color:#cba6f7;\">char<\/span> <span style=\"color:#89b4fa;\">str<\/span>[] = <span style=\"color:#a6e3a1;\">\"Hello\"<\/span>;\n    <span style=\"color:#cba6f7;\">size_t<\/span> <span style=\"color:#89b4fa;\">len<\/span> = <span style=\"color:#89b4fa;\">strlen<\/span>(str);\n    <span style=\"color:#89b4fa;\">printf<\/span>(<span style=\"color:#a6e3a1;\">\"\u9577\u3055: %zu\\n\"<\/span>, len);  <span style=\"color:#6c7086;\">\/* 5\uff08\u7d42\u7aef\u6587\u5b57\u3092\u542b\u307e\u306a\u3044\uff09 *\/<\/span>\n\n    <span style=\"color:#6c7086;\">\/* sizeof \u3068\u306e\u6bd4\u8f03 *\/<\/span>\n    <span style=\"color:#89b4fa;\">printf<\/span>(<span style=\"color:#a6e3a1;\">\"sizeof: %zu\\n\"<\/span>, <span style=\"color:#89b4fa;\">sizeof<\/span>(str));  <span style=\"color:#6c7086;\">\/* 6\uff08\u7d42\u7aef\u6587\u5b57\u3092\u542b\u3080\uff09 *\/<\/span>\n\n    <span style=\"color:#cba6f7;\">return<\/span> <span style=\"color:#fab387;\">0<\/span>;\n}<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">strcpy\u30fbstrncpy\uff1a\u6587\u5b57\u5217\u3092\u30b3\u30d4\u30fc\u3059\u308b<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">C\u8a00\u8a9e\u3067\u306f\u300cstr1 = str2;\u300d\u306e\u3088\u3046\u306a\u914d\u5217\u3078\u306e\u76f4\u63a5\u4ee3\u5165\u306f\u3067\u304d\u307e\u305b\u3093\u3002\u6587\u5b57\u5217\u3092\u30b3\u30d4\u30fc\u3059\u308b\u306b\u306f<code>strcpy<\/code>\u307e\u305f\u306f<code>strncpy<\/code>\u3092\u4f7f\u3044\u307e\u3059\u3002strncpy\u306f\u30b3\u30d4\u30fc\u3059\u308b\u6700\u5927\u6587\u5b57\u6570\u3092\u6307\u5b9a\u3067\u304d\u308b\u305f\u3081\u3001\u30d0\u30c3\u30d5\u30a1\u30aa\u30fc\u30d0\u30fc\u30d5\u30ed\u30fc\u5bfe\u7b56\u3068\u3057\u3066\u5b9f\u52d9\u3067\u3088\u304f\u4f7f\u308f\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<div style=\"background:#f8f9fa;border-left:4px solid #6b7280;border-radius:0 8px 8px 0;padding:16px 20px;margin:20px 0;\">\n  <p style=\"margin:0 0 4px;font-size:13px;font-weight:700;color:#6b7280;letter-spacing:1px;\">&#128218; \u7528\u8a9e\u89e3\u8aac<\/p>\n  <p style=\"margin:0;font-size:15px;line-height:1.7;\"><strong>\u30d0\u30c3\u30d5\u30a1\u30aa\u30fc\u30d0\u30fc\u30d5\u30ed\u30fc<\/strong>\uff1a\u914d\u5217\uff08\u30d0\u30c3\u30d5\u30a1\uff09\u306e\u30b5\u30a4\u30ba\u3092\u8d85\u3048\u3066\u30c7\u30fc\u30bf\u3092\u66f8\u304d\u8fbc\u3093\u3067\u3057\u307e\u3046\u30d0\u30b0\u3002C\u8a00\u8a9e\u306e\u6587\u5b57\u5217\u51e6\u7406\u3067\u306f\u7279\u306b\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3001\u30b3\u30d4\u30fc\u5148\u306e\u914d\u5217\u30b5\u30a4\u30ba\u4ee5\u4e0a\u306e\u30c7\u30fc\u30bf\u3092strcpy\u3067\u66f8\u304d\u8fbc\u3080\u3068\u96a3\u63a5\u3059\u308b\u30e1\u30e2\u30ea\u9818\u57df\u3092\u7834\u58ca\u3057\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u30af\u30e9\u30c3\u30b7\u30e5\u3084\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u8106\u5f31\u6027\u306e\u539f\u56e0\u306b\u306a\u308a\u307e\u3059\u3002strncpy\u3092\u4f7f\u3063\u3066\u30b3\u30d4\u30fc\u91cf\u3092\u5236\u9650\u3059\u308b\u306e\u304c\u5b89\u5168\u3067\u3059\u3002<\/p>\n<\/div>\n\n\n\n<div style=\"background:#1e1e2e;border-radius:10px;padding:20px 24px;margin:20px 0;font-family:monospace;font-size:14px;line-height:1.8;color:#cdd6f4;overflow-x:auto;white-space:pre;\"><span style=\"color:#89b4fa;\">#include<\/span> <span style=\"color:#a6e3a1;\">&lt;stdio.h&gt;<\/span>\n<span style=\"color:#89b4fa;\">#include<\/span> <span style=\"color:#a6e3a1;\">&lt;string.h&gt;<\/span>\n\n<span style=\"color:#cba6f7;\">int<\/span> <span style=\"color:#89b4fa;\">main<\/span>() {\n    <span style=\"color:#cba6f7;\">char<\/span> <span style=\"color:#89b4fa;\">src<\/span>[] = <span style=\"color:#a6e3a1;\">\"Hello\"<\/span>;\n    <span style=\"color:#cba6f7;\">char<\/span> <span style=\"color:#89b4fa;\">dst1<\/span>[<span style=\"color:#fab387;\">10<\/span>];\n    <span style=\"color:#cba6f7;\">char<\/span> <span style=\"color:#89b4fa;\">dst2<\/span>[<span style=\"color:#fab387;\">10<\/span>];\n\n    <span style=\"color:#6c7086;\">\/* strcpy: \u30b3\u30d4\u30fc\u5148\u306b\u5341\u5206\u306a\u30b5\u30a4\u30ba\u304c\u5fc5\u8981 *\/<\/span>\n    <span style=\"color:#89b4fa;\">strcpy<\/span>(dst1, src);\n    <span style=\"color:#89b4fa;\">printf<\/span>(<span style=\"color:#a6e3a1;\">\"strcpy: %s\\n\"<\/span>, dst1);  <span style=\"color:#6c7086;\">\/* Hello *\/<\/span>\n\n    <span style=\"color:#6c7086;\">\/* strncpy: \u30b5\u30a4\u30ba\u3092\u6307\u5b9a\u3057\u3066\u30d0\u30c3\u30d5\u30a1\u30aa\u30fc\u30d0\u30fc\u30d5\u30ed\u30fc\u5bfe\u7b56 *\/<\/span>\n    <span style=\"color:#89b4fa;\">strncpy<\/span>(dst2, src, <span style=\"color:#89b4fa;\">sizeof<\/span>(dst2) - <span style=\"color:#fab387;\">1<\/span>);\n    dst2[<span style=\"color:#89b4fa;\">sizeof<\/span>(dst2) - <span style=\"color:#fab387;\">1<\/span>] = <span style=\"color:#a6e3a1;\">'\\0'<\/span>;  <span style=\"color:#6c7086;\">\/* \u7d42\u7aef\u6587\u5b57\u3092\u660e\u793a\u7684\u306b\u8ffd\u52a0 *\/<\/span>\n    <span style=\"color:#89b4fa;\">printf<\/span>(<span style=\"color:#a6e3a1;\">\"strncpy: %s\\n\"<\/span>, dst2);\n\n    <span style=\"color:#cba6f7;\">return<\/span> <span style=\"color:#fab387;\">0<\/span>;\n}<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">strcat\uff1a\u6587\u5b57\u5217\u3092\u9023\u7d50\u3059\u308b<\/h3>\n\n\n\n<div style=\"background:#1e1e2e;border-radius:10px;padding:20px 24px;margin:20px 0;font-family:monospace;font-size:14px;line-height:1.8;color:#cdd6f4;overflow-x:auto;white-space:pre;\"><span style=\"color:#89b4fa;\">#include<\/span> <span style=\"color:#a6e3a1;\">&lt;stdio.h&gt;<\/span>\n<span style=\"color:#89b4fa;\">#include<\/span> <span style=\"color:#a6e3a1;\">&lt;string.h&gt;<\/span>\n\n<span style=\"color:#cba6f7;\">int<\/span> <span style=\"color:#89b4fa;\">main<\/span>() {\n    <span style=\"color:#cba6f7;\">char<\/span> <span style=\"color:#89b4fa;\">str1<\/span>[<span style=\"color:#fab387;\">20<\/span>] = <span style=\"color:#a6e3a1;\">\"Hello, \"<\/span>;  <span style=\"color:#6c7086;\">\/* \u9023\u7d50\u5f8c\u306e\u9577\u3055\u5206\u306e\u30b9\u30da\u30fc\u30b9\u304c\u5fc5\u8981 *\/<\/span>\n    <span style=\"color:#cba6f7;\">char<\/span> <span style=\"color:#89b4fa;\">str2<\/span>[] = <span style=\"color:#a6e3a1;\">\"World!\"<\/span>;\n\n    <span style=\"color:#89b4fa;\">strcat<\/span>(str1, str2);  <span style=\"color:#6c7086;\">\/* str1\u306e\u672b\u5c3e\u306bstr2\u3092\u9023\u7d50 *\/<\/span>\n    <span style=\"color:#89b4fa;\">printf<\/span>(<span style=\"color:#a6e3a1;\">\"%s\\n\"<\/span>, str1);  <span style=\"color:#6c7086;\">\/* Hello, World! *\/<\/span>\n\n    <span style=\"color:#cba6f7;\">return<\/span> <span style=\"color:#fab387;\">0<\/span>;\n}<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">strcmp\uff1a\u6587\u5b57\u5217\u3092\u6bd4\u8f03\u3059\u308b<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u6587\u5b57\u5217\u306e\u5185\u5bb9\u3092\u6bd4\u8f03\u3059\u308b\u306b\u306f<code>strcmp<\/code>\u3092\u4f7f\u3044\u307e\u3059\u3002C\u8a00\u8a9e\u3067\u306f\u300cif (str1 == str2)\u300d\u3068\u66f8\u3044\u3066\u3082\u30a2\u30c9\u30ec\u30b9\u306e\u6bd4\u8f03\u306b\u306a\u308a\u3001\u6587\u5b57\u5217\u306e\u5185\u5bb9\u6bd4\u8f03\u306b\u306f\u306a\u308a\u307e\u305b\u3093\u3002\u5fc5\u305astrcmp\u3092\u4f7f\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<div style=\"background:#1e1e2e;border-radius:10px;padding:20px 24px;margin:20px 0;font-family:monospace;font-size:14px;line-height:1.8;color:#cdd6f4;overflow-x:auto;white-space:pre;\"><span style=\"color:#89b4fa;\">#include<\/span> <span style=\"color:#a6e3a1;\">&lt;stdio.h&gt;<\/span>\n<span style=\"color:#89b4fa;\">#include<\/span> <span style=\"color:#a6e3a1;\">&lt;string.h&gt;<\/span>\n\n<span style=\"color:#cba6f7;\">int<\/span> <span style=\"color:#89b4fa;\">main<\/span>() {\n    <span style=\"color:#cba6f7;\">char<\/span> <span style=\"color:#89b4fa;\">a<\/span>[] = <span style=\"color:#a6e3a1;\">\"apple\"<\/span>;\n    <span style=\"color:#cba6f7;\">char<\/span> <span style=\"color:#89b4fa;\">b<\/span>[] = <span style=\"color:#a6e3a1;\">\"apple\"<\/span>;\n    <span style=\"color:#cba6f7;\">char<\/span> <span style=\"color:#89b4fa;\">c<\/span>[] = <span style=\"color:#a6e3a1;\">\"banana\"<\/span>;\n\n    <span style=\"color:#6c7086;\">\/* \u623b\u308a\u5024: 0=\u7b49\u3057\u3044, \u8ca0=a\u304cb\u3088\u308a\u5c0f\u3055\u3044, \u6b63=a\u304cb\u3088\u308a\u5927\u304d\u3044 *\/<\/span>\n    <span style=\"color:#89b4fa;\">printf<\/span>(<span style=\"color:#a6e3a1;\">\"%d\\n\"<\/span>, <span style=\"color:#89b4fa;\">strcmp<\/span>(a, b));  <span style=\"color:#6c7086;\">\/* 0 (\u7b49\u3057\u3044) *\/<\/span>\n    <span style=\"color:#89b4fa;\">printf<\/span>(<span style=\"color:#a6e3a1;\">\"%d\\n\"<\/span>, <span style=\"color:#89b4fa;\">strcmp<\/span>(a, c));  <span style=\"color:#6c7086;\">\/* \u8ca0\u306e\u5024 (apple\u306fbanana\u3088\u308a\u5c0f\u3055\u3044) *\/<\/span>\n\n    <span style=\"color:#6c7086;\">\/* \u6587\u5b57\u5217\u6bd4\u8f03\u306e\u6b63\u3057\u3044\u4f7f\u3044\u65b9 *\/<\/span>\n    <span style=\"color:#cba6f7;\">if<\/span> (<span style=\"color:#89b4fa;\">strcmp<\/span>(a, b) == <span style=\"color:#fab387;\">0<\/span>) {\n        <span style=\"color:#89b4fa;\">printf<\/span>(<span style=\"color:#a6e3a1;\">\"\u7b49\u3057\u3044\\n\"<\/span>);\n    }\n\n    <span style=\"color:#6c7086;\">\/* NG\u4f8b: == \u3067\u6bd4\u8f03\u3057\u3066\u3082\u30a2\u30c9\u30ec\u30b9\u6bd4\u8f03\u306b\u306a\u308b *\/<\/span>\n    <span style=\"color:#6c7086;\">\/* if (a == b) { ... }  \u2190 \u3053\u308c\u306f\u6587\u5b57\u5217\u5185\u5bb9\u306e\u6bd4\u8f03\u3067\u306f\u306a\u3044 *\/<\/span>\n\n    <span style=\"color:#cba6f7;\">return<\/span> <span style=\"color:#fab387;\">0<\/span>;\n}<\/div>\n\n\n\n<div style=\"background:#fff5f5;border-left:4px solid #ef4444;border-radius:0 8px 8px 0;padding:16px 20px;margin:20px 0;\">\n  <p style=\"margin:0 0 4px;font-size:13px;font-weight:700;color:#ef4444;letter-spacing:1px;\">&#9888;&#65039; ==\u3067\u6587\u5b57\u5217\u6bd4\u8f03\u3092\u3059\u308b\u306e\u306f\u30d0\u30b0\u306e\u539f\u56e0<\/p>\n  <p style=\"margin:0;font-size:15px;line-height:1.7;\">C\u8a00\u8a9e\u3067\u300cif (str1 == str2)\u300d\u3068\u66f8\u304f\u3068\u3001\u6587\u5b57\u5217\u306e\u5185\u5bb9\u3067\u306f\u306a\u304f\u30e1\u30e2\u30ea\u30a2\u30c9\u30ec\u30b9\u3092\u6bd4\u8f03\u3057\u307e\u3059\u3002\u540c\u3058\u5185\u5bb9\u306e\u6587\u5b57\u5217\u3067\u3082\u683c\u7d0d\u5834\u6240\u304c\u7570\u306a\u308c\u3070\u300c\u4e0d\u4e00\u81f4\u300d\u3068\u5224\u5b9a\u3055\u308c\u307e\u3059\u3002\u6587\u5b57\u5217\u306e\u5185\u5bb9\u3092\u6bd4\u8f03\u3059\u308b\u3068\u304d\u306f\u5fc5\u305a<code>strcmp(str1, str2) == 0<\/code>\u3092\u4f7f\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<\/div>\n\n\n<div style=\"margin:48px 0 8px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap;\"><a href=\"https:\/\/aikanri.genai-ai.co.jp\/seminar2-blog\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_content=cc-c-char-string&#038;blog_slug=cc-c-char-string\" target=\"_blank\" rel=\"noopener\" aria-label=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff08\u7121\u6599\u30fb1on1\u30fb60\u5206\uff09\u306e\u4e88\u7d04\u753b\u9762\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_seminar_claude_code_2026.jpg\" alt=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff5c\u7d4c\u55b6\u8005\u30fb\u4f1a\u793e\u5f79\u54e1\u5c02\u7528 1on1 60\u5206 \u7121\u6599\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><a href=\"https:\/\/aikanri.genai-ai.co.jp\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_campaign=cc-c-char-string&#038;utm_content=h2-banner-kanri\" target=\"_blank\" rel=\"noopener\" aria-label=\"AI\u9b3c\u7ba1\u7406 \u516c\u5f0f\u30b5\u30a4\u30c8\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_blog_1to1.jpg\" alt=\"Claude Code\u3092\u7d4c\u55b6\u306b\u6d3b\u304b\u3057\u305f\u3044\u65b9\u3078 \u2014 AI\u9b3c\u7ba1\u7406\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"sec-05\">Claude Code\u3067char\u578b\u30fb\u6587\u5b57\u5217\u51e6\u7406\u3092\u81ea\u52d5\u751f\u6210\u3059\u308b\u5b9f\u8df5\u7684\u306a\u4f7f\u3044\u65b9<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">C\u8a00\u8a9e\u306echar\u578b\u30fb\u6587\u5b57\u5217\u51e6\u7406\u306f\u30eb\u30fc\u30eb\u304c\u591a\u304f\u3001\u521d\u5fc3\u8005\u304c\u7279\u306b\u3064\u307e\u305a\u304d\u3084\u3059\u3044\u90e8\u5206\u3067\u3059\u3002Claude Code\u3092\u6d3b\u7528\u3059\u308c\u3070\u3001\u65e5\u672c\u8a9e\u3067\u8981\u4ef6\u3092\u8aac\u660e\u3059\u308b\u3060\u3051\u3067\u9069\u5207\u306a\u6587\u5b57\u5217\u51e6\u7406\u30b3\u30fc\u30c9\u3092\u81ea\u52d5\u751f\u6210\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"g-flow-row\" style=\"display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:20px 0;padding:20px;background:#f8fafc;border-radius:12px;\">\n<div style=\"background:#1e3a5f;color:#fff;border-radius:8px;padding:12px 18px;font-size:14px;font-weight:600;text-align:center;min-width:120px;\">\u65e5\u672c\u8a9e\u3067\u8981\u4ef6\u3092\u8aac\u660e<\/div><div style=\"font-size:22px;color:#64748b;margin:0 6px;\">&#8594;<\/div><div style=\"background:#1e3a5f;color:#fff;border-radius:8px;padding:12px 18px;font-size:14px;font-weight:600;text-align:center;min-width:120px;\">Claude Code\u304c\u751f\u6210<\/div><div style=\"font-size:22px;color:#64748b;margin:0 6px;\">&#8594;<\/div><div style=\"background:#1e3a5f;color:#fff;border-radius:8px;padding:12px 18px;font-size:14px;font-weight:600;text-align:center;min-width:120px;\">\u30b3\u30f3\u30d1\u30a4\u30eb\u78ba\u8a8d<\/div><div style=\"font-size:22px;color:#64748b;margin:0 6px;\">&#8594;<\/div><div style=\"background:#1e3a5f;color:#fff;border-radius:8px;padding:12px 18px;font-size:14px;font-weight:600;text-align:center;min-width:120px;\">\u52d5\u4f5c\u30c6\u30b9\u30c8<\/div><div style=\"font-size:22px;color:#64748b;margin:0 6px;\">&#8594;<\/div><div style=\"background:#1e3a5f;color:#fff;border-radius:8px;padding:12px 18px;font-size:14px;font-weight:600;text-align:center;min-width:120px;\">\u5b8c\u6210<\/div>\n<\/div>\n\n\n\n<div style=\"background:#1e1e2e;border-radius:10px;padding:20px 24px;margin:20px 0;font-family:monospace;font-size:14px;line-height:1.8;color:#cdd6f4;overflow-x:auto;white-space:pre;\"><span style=\"color:#6c7086;\">\/\/ Claude Code\u3078\u306e\u6307\u793a\u4f8b\uff08\u65e5\u672c\u8a9e\u3067OK\uff09<\/span>\n\n<span style=\"color:#a6e3a1;\">\"C\u8a00\u8a9e\u3067\u30e6\u30fc\u30b6\u30fc\u304b\u3089\u6587\u5b57\u5217\u3092\u5165\u529b\u3055\u305b\u3066\u3001\n\u305d\u306e\u6587\u5b57\u5217\u3092\u9006\u9806\u306b\u3057\u3066\u8868\u793a\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u3063\u3066\u3002\n\u30d0\u30c3\u30d5\u30a1\u30aa\u30fc\u30d0\u30fc\u30d5\u30ed\u30fc\u5bfe\u7b56\u3082\u542b\u3081\u3066\u3002\"<\/span>\n\n<span style=\"color:#a6e3a1;\">\"C\u8a00\u8a9e\u3067CSV\u306e1\u884c\u3092\u8aad\u307f\u8fbc\u3093\u3067\u30ab\u30f3\u30de\u3067\u5206\u5272\u3057\u3001\n\u5404\u30d5\u30a3\u30fc\u30eb\u30c9\u3092char\u914d\u5217\u306b\u683c\u7d0d\u3059\u308b\u30b3\u30fc\u30c9\u3092\u4f5c\u3063\u3066\u3002\"<\/span>\n\n<span style=\"color:#a6e3a1;\">\"C\u8a00\u8a9e\u3067\u6587\u5b57\u5217\u4e2d\u306e\u7279\u5b9a\u306e\u6587\u5b57\u3092\u5225\u306e\u6587\u5b57\u306b\u7f6e\u63db\u3059\u308b\n\u95a2\u6570\u3092\u4f5c\u3063\u3066\u3002string.h\u3092\u4f7f\u308f\u305a\u306b\u81ea\u524d\u3067\u5b9f\u88c5\u3057\u3066\u3002\"<\/span><\/div>\n\n\n\n<div style=\"background:#f0fdf4;border-left:4px solid #22c55e;border-radius:0 8px 8px 0;padding:16px 20px;margin:20px 0;\">\n  <p style=\"margin:0 0 4px;font-size:13px;font-weight:700;color:#22c55e;letter-spacing:1px;\">&#128161; Claude Code\u306fchar\u578b\u306e\u7f60\u3082\u81ea\u52d5\u56de\u907f<\/p>\n  <p style=\"margin:0;font-size:15px;line-height:1.7;\">\u30d0\u30c3\u30d5\u30a1\u30aa\u30fc\u30d0\u30fc\u30d5\u30ed\u30fc\u5bfe\u7b56\uff08strncpy\u306e\u4f7f\u7528\u3001\u914d\u5217\u30b5\u30a4\u30ba\u306e\u9069\u5207\u306a\u8a08\u7b97\uff09\u3001\u6587\u5b57\u5217\u6bd4\u8f03\u306estrcmp\u4f7f\u7528\u3001\u7d42\u7aef\u6587\u5b57\u306e\u660e\u793a\u7684\u306a\u8ffd\u52a0\u306a\u3069\u3001C\u8a00\u8a9e\u306e\u6587\u5b57\u5217\u51e6\u7406\u3067\u521d\u5fc3\u8005\u304c\u9665\u308a\u3084\u3059\u3044\u30df\u30b9\u3092Claude Code\u306f\u81ea\u52d5\u7684\u306b\u907f\u3051\u305f\u30b3\u30fc\u30c9\u3092\u751f\u6210\u3057\u307e\u3059\u3002\u751f\u6210\u3055\u308c\u305f\u30b3\u30fc\u30c9\u306f\u305d\u306e\u307e\u307e\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u3066\u52d5\u4f5c\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">C\u8a00\u8a9e\u306echar\u578b\u30fb\u6587\u5b57\u5217\u51e6\u7406\u306f\u30dd\u30a4\u30f3\u30bf\u3084\u7d42\u7aef\u6587\u5b57\u306a\u3069\u72ec\u7279\u306e\u6982\u5ff5\u304c\u591a\u304f\u3001\u6163\u308c\u308b\u307e\u3067\u6642\u9593\u304c\u304b\u304b\u308a\u307e\u3059\u3002\u3057\u304b\u3057strcpy\u30fbstrcat\u30fbstrcmp\u30fbstrlen\u306e4\u3064\u306e\u57fa\u672c\u95a2\u6570\u3092\u3057\u3063\u304b\u308a\u4f7f\u3044\u3053\u306a\u305b\u308c\u3070\u3001\u5b9f\u52d9\u30ec\u30d9\u30eb\u306e\u6587\u5b57\u5217\u51e6\u7406\u306f\u5bfe\u5fdc\u3067\u304d\u307e\u3059\u3002Claude Code\u3092\u6d3b\u7528\u3057\u3066\u30b3\u30fc\u30c9\u306e\u96db\u5f62\u3092\u751f\u6210\u3057\u3001\u305d\u306e\u52d5\u4f5c\u3092\u4e00\u884c\u305a\u3064\u78ba\u8a8d\u3057\u306a\u304c\u3089\u5b66\u3076\u3053\u3068\u3067\u3001C\u8a00\u8a9e\u306e\u6587\u5b57\u5217\u51e6\u7406\u306e\u7406\u89e3\u304c\u6df1\u307e\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"faq\">\u3088\u304f\u3042\u308b\u8cea\u554f<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Q. C\u8a00\u8a9e\u306echar\u578b\u3067\u6587\u5b57\u5217\u3092\u683c\u7d0d\u3059\u308b\u306b\u306f\u3069\u3046\u3059\u308c\u3070\u3044\u3044\u3067\u3059\u304b\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A. char\u914d\u5217\uff08char str[\u30b5\u30a4\u30ba] = \"\u6587\u5b57\u5217\"\uff09\u3092\u4f7f\u3044\u307e\u3059\u3002\u30b5\u30a4\u30ba\u306f\u6587\u5b57\u6570+1\uff08\u7d42\u7aef\u6587\u5b57\u5206\uff09\u304c\u5fc5\u8981\u3067\u3059\u3002\u30b5\u30a4\u30ba\u3092\u7701\u7565\u3057\u305f\u300cchar str[] = \"Hello\";\u300d\u306e\u66f8\u304d\u65b9\u304c\u30b7\u30f3\u30d7\u30eb\u3067\u5b9f\u7528\u7684\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Q. char\u914d\u5217\u3068char*\uff08\u30dd\u30a4\u30f3\u30bf\uff09\u306e\u9055\u3044\u306f\u4f55\u3067\u3059\u304b\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A. char\u914d\u5217\u306f\u30b9\u30bf\u30c3\u30af\u306b\u30c7\u30fc\u30bf\u304c\u683c\u7d0d\u3055\u308c\u3001\u5185\u5bb9\u3092\u66f8\u304d\u63db\u3048\u3089\u308c\u307e\u3059\u3002char*\u3067\u6587\u5b57\u5217\u30ea\u30c6\u30e9\u30eb\u3092\u6307\u3059\u5834\u5408\u306f\u8aad\u307f\u53d6\u308a\u5c02\u7528\u3067\u66f8\u304d\u63db\u3048\u308b\u3068\u672a\u5b9a\u7fa9\u52d5\u4f5c\u306b\u306a\u308a\u307e\u3059\u3002\u307e\u305fsizeof()\u306e\u7d50\u679c\u3082\u7570\u306a\u308a\u3001\u914d\u5217\u306f\u30d0\u30a4\u30c8\u6570+1\u3001\u30dd\u30a4\u30f3\u30bf\u306f\u30a2\u30c9\u30ec\u30b9\u306e\u30b5\u30a4\u30ba\uff084or8\u30d0\u30a4\u30c8\uff09\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Q. C\u8a00\u8a9e\u306e\u6587\u5b57\u5217\u3092\u6bd4\u8f03\u3059\u308b\u306b\u306f\u3069\u3046\u3059\u308c\u3070\u3044\u3044\u3067\u3059\u304b\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A. string.h\u306estrcmp\u95a2\u6570\u3092\u4f7f\u3044\u307e\u3059\u3002\u300cstrcmp(str1, str2) == 0\u300d\u3067\u7b49\u3057\u3044\u5834\u5408\u3092\u5224\u5b9a\u3067\u304d\u307e\u3059\u3002\u300c==\u6f14\u7b97\u5b50\u300d\u306f\u6587\u5b57\u5217\u5185\u5bb9\u306e\u6bd4\u8f03\u3067\u306f\u306a\u304f\u30a2\u30c9\u30ec\u30b9\u6bd4\u8f03\u306b\u306a\u308b\u305f\u3081\u3001\u6587\u5b57\u5217\u6bd4\u8f03\u306b\u306f\u4f7f\u3048\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Q. \u6587\u5b57\u5217\u3092\u30b3\u30d4\u30fc\u3059\u308b\u3068\u304d\u914d\u5217\u3078\u306e\u76f4\u63a5\u4ee3\u5165\uff08str1 = str2\uff09\u306f\u3067\u304d\u307e\u3059\u304b\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A. \u3067\u304d\u307e\u305b\u3093\u3002C\u8a00\u8a9e\u3067\u306f\u914d\u5217\u540c\u58eb\u306e\u76f4\u63a5\u4ee3\u5165\u306f\u3067\u304d\u305a\u3001\u6587\u5b57\u5217\u30b3\u30d4\u30fc\u306b\u306fstrcpy\u307e\u305f\u306fstrncpy\u3092\u4f7f\u3044\u307e\u3059\u3002strncpy\u306f\u30b3\u30d4\u30fc\u3059\u308b\u6700\u5927\u6587\u5b57\u6570\u3092\u6307\u5b9a\u3067\u304d\u308b\u305f\u3081\u30d0\u30c3\u30d5\u30a1\u30aa\u30fc\u30d0\u30fc\u30d5\u30ed\u30fc\u5bfe\u7b56\u3068\u3057\u3066\u63a8\u5968\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Q. strlen\u95a2\u6570\u306f\u3069\u306e\u3088\u3046\u306b\u3057\u3066\u6587\u5b57\u5217\u306e\u9577\u3055\u3092\u8abf\u3079\u307e\u3059\u304b\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A. strlen\u95a2\u6570\u306f\u6587\u5b57\u5217\u306e\u5148\u982d\u304b\u3089\u7d42\u7aef\u6587\u5b57\uff08\\0\uff09\u304c\u898b\u3064\u304b\u308b\u307e\u3067\u306e\u6587\u5b57\u6570\u3092\u6570\u3048\u307e\u3059\u3002\u7d42\u7aef\u6587\u5b57\u305d\u306e\u3082\u306e\u306f\u9577\u3055\u306b\u542b\u307e\u308c\u307e\u305b\u3093\u3002sizeof\u6f14\u7b97\u5b50\u3068\u7570\u306a\u308a\u3001\u5b9f\u969b\u306b\u683c\u7d0d\u3055\u308c\u3066\u3044\u308b\u6587\u5b57\u5217\u9577\u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<script type=\"application\/ld+json\">\n{\n  \"@context\": \"https:\/\/schema.org\",\n  \"@type\": \"FAQPage\",\n  \"mainEntity\": [\n    {\n      \"@type\": \"Question\",\n      \"name\": \"C\u8a00\u8a9e\u306echar\u578b\u3067\u6587\u5b57\u5217\u3092\u683c\u7d0d\u3059\u308b\u306b\u306f\u3069\u3046\u3059\u308c\u3070\u3044\u3044\u3067\u3059\u304b\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"char\u914d\u5217\uff08char str[\u30b5\u30a4\u30ba] = \\\"\u6587\u5b57\u5217\\\"\uff09\u3092\u4f7f\u3044\u307e\u3059\u3002\u30b5\u30a4\u30ba\u306f\u6587\u5b57\u6570+1\uff08\u7d42\u7aef\u6587\u5b57\u5206\uff09\u304c\u5fc5\u8981\u3067\u3059\u3002\u30b5\u30a4\u30ba\u3092\u7701\u7565\u3057\u305f\u300cchar str[] = \\\"Hello\\\";\u300d\u306e\u66f8\u304d\u65b9\u304c\u30b7\u30f3\u30d7\u30eb\u3067\u5b9f\u7528\u7684\u3067\u3059\u3002\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"char\u914d\u5217\u3068char*\uff08\u30dd\u30a4\u30f3\u30bf\uff09\u306e\u9055\u3044\u306f\u4f55\u3067\u3059\u304b\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"char\u914d\u5217\u306f\u30b9\u30bf\u30c3\u30af\u306b\u30c7\u30fc\u30bf\u304c\u683c\u7d0d\u3055\u308c\u3001\u5185\u5bb9\u3092\u66f8\u304d\u63db\u3048\u3089\u308c\u307e\u3059\u3002char*\u3067\u6587\u5b57\u5217\u30ea\u30c6\u30e9\u30eb\u3092\u6307\u3059\u5834\u5408\u306f\u8aad\u307f\u53d6\u308a\u5c02\u7528\u3067\u66f8\u304d\u63db\u3048\u308b\u3068\u672a\u5b9a\u7fa9\u52d5\u4f5c\u306b\u306a\u308a\u307e\u3059\u3002\u307e\u305fsizeof()\u306e\u7d50\u679c\u3082\u7570\u306a\u308a\u3001\u914d\u5217\u306f\u30d0\u30a4\u30c8\u6570+1\u3001\u30dd\u30a4\u30f3\u30bf\u306f\u30a2\u30c9\u30ec\u30b9\u306e\u30b5\u30a4\u30ba\uff084or8\u30d0\u30a4\u30c8\uff09\u306b\u306a\u308a\u307e\u3059\u3002\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"C\u8a00\u8a9e\u306e\u6587\u5b57\u5217\u3092\u6bd4\u8f03\u3059\u308b\u306b\u306f\u3069\u3046\u3059\u308c\u3070\u3044\u3044\u3067\u3059\u304b\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"string.h\u306estrcmp\u95a2\u6570\u3092\u4f7f\u3044\u307e\u3059\u3002\u300cstrcmp(str1, str2) == 0\u300d\u3067\u7b49\u3057\u3044\u5834\u5408\u3092\u5224\u5b9a\u3067\u304d\u307e\u3059\u3002\u300c==\u6f14\u7b97\u5b50\u300d\u306f\u6587\u5b57\u5217\u5185\u5bb9\u306e\u6bd4\u8f03\u3067\u306f\u306a\u304f\u30a2\u30c9\u30ec\u30b9\u6bd4\u8f03\u306b\u306a\u308b\u305f\u3081\u3001\u6587\u5b57\u5217\u6bd4\u8f03\u306b\u306f\u4f7f\u3048\u307e\u305b\u3093\u3002\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"\u6587\u5b57\u5217\u3092\u30b3\u30d4\u30fc\u3059\u308b\u3068\u304d\u914d\u5217\u3078\u306e\u76f4\u63a5\u4ee3\u5165\uff08str1 = str2\uff09\u306f\u3067\u304d\u307e\u3059\u304b\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"\u3067\u304d\u307e\u305b\u3093\u3002C\u8a00\u8a9e\u3067\u306f\u914d\u5217\u540c\u58eb\u306e\u76f4\u63a5\u4ee3\u5165\u306f\u3067\u304d\u305a\u3001\u6587\u5b57\u5217\u30b3\u30d4\u30fc\u306b\u306fstrcpy\u307e\u305f\u306fstrncpy\u3092\u4f7f\u3044\u307e\u3059\u3002strncpy\u306f\u30b3\u30d4\u30fc\u3059\u308b\u6700\u5927\u6587\u5b57\u6570\u3092\u6307\u5b9a\u3067\u304d\u308b\u305f\u3081\u30d0\u30c3\u30d5\u30a1\u30aa\u30fc\u30d0\u30fc\u30d5\u30ed\u30fc\u5bfe\u7b56\u3068\u3057\u3066\u63a8\u5968\u3055\u308c\u307e\u3059\u3002\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"strlen\u95a2\u6570\u306f\u3069\u306e\u3088\u3046\u306b\u3057\u3066\u6587\u5b57\u5217\u306e\u9577\u3055\u3092\u8abf\u3079\u307e\u3059\u304b\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"strlen\u95a2\u6570\u306f\u6587\u5b57\u5217\u306e\u5148\u982d\u304b\u3089\u7d42\u7aef\u6587\u5b57\uff08\\\\0\uff09\u304c\u898b\u3064\u304b\u308b\u307e\u3067\u306e\u6587\u5b57\u6570\u3092\u6570\u3048\u307e\u3059\u3002\u7d42\u7aef\u6587\u5b57\u305d\u306e\u3082\u306e\u306f\u9577\u3055\u306b\u542b\u307e\u308c\u307e\u305b\u3093\u3002sizeof\u6f14\u7b97\u5b50\u3068\u7570\u306a\u308a\u3001\u5b9f\u969b\u306b\u683c\u7d0d\u3055\u308c\u3066\u3044\u308b\u6587\u5b57\u5217\u9577\u3092\u8fd4\u3057\u307e\u3059\u3002\"\n      }\n    }\n  ]\n}\n<\/script>\n\n\n\n<h3 style=\"font-size:18px;font-weight:700;margin:32px 0 16px;padding-left:12px;border-left:4px solid #7c3aed;\">char\u578b\u30fb\u6587\u5b57\u5217\u51e6\u7406\u3067\u3088\u304f\u3042\u308b\u30d0\u30b0\u3068\u30c7\u30d0\u30c3\u30b0\u306e\u8003\u3048\u65b9<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">C\u8a00\u8a9e\u306echar\u578b\u30fb\u6587\u5b57\u5217\u51e6\u7406\u3067\u306f\u3001\u521d\u5fc3\u8005\u3060\u3051\u3067\u306a\u304f\u7d4c\u9a13\u8005\u3082\u9665\u308b\u30d0\u30b0\u306e\u30d1\u30bf\u30fc\u30f3\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u3088\u304f\u3042\u308b\u30d0\u30b0\u306e\u539f\u56e0\u3068\u5bfe\u7b56\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u30d0\u30b0\u30d1\u30bf\u30fc\u30f31\uff1a\u914d\u5217\u30b5\u30a4\u30ba\u304c1\u30d0\u30a4\u30c8\u8db3\u308a\u306a\u3044<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u300cchar str[5] = \"Hello\";\u300d\u3068\u66f8\u304f\u3068\u3001\u7d42\u7aef\u6587\u5b57\uff08\\0\uff09\u3092\u683c\u7d0d\u3059\u308b\u30b9\u30da\u30fc\u30b9\u304c\u8db3\u308a\u307e\u305b\u3093\u3002\"Hello\"\u306f5\u6587\u5b57\u306a\u306e\u3067\u7d42\u7aef\u6587\u5b57\u3092\u542b\u3080\u30686\u30d0\u30a4\u30c8\u5fc5\u8981\u3067\u3059\u30025\u30d0\u30a4\u30c8\u3057\u304b\u306a\u3044\u3068\u7d42\u7aef\u6587\u5b57\u304c\u96a3\u306e\u30e1\u30e2\u30ea\u9818\u57df\u306b\u66f8\u304d\u8fbc\u307e\u308c\u3001\u30e1\u30e2\u30ea\u7834\u58ca\u304c\u8d77\u304d\u307e\u3059\u3002\u3053\u306e\u30d0\u30b0\u306f\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u30a8\u30e9\u30fc\u304c\u51fa\u306a\u3044\u3053\u3068\u304c\u3042\u308a\u3001\u5b9f\u884c\u6642\u306b\u4e0d\u53ef\u89e3\u306a\u52d5\u4f5c\u3068\u3057\u3066\u73fe\u308c\u307e\u3059\u3002\u914d\u5217\u30b5\u30a4\u30ba\u3092\u6c7a\u3081\u308b\u3068\u304d\u306f\u5e38\u306b\u300c\u6587\u5b57\u6570+1\u300d\u3092\u610f\u8b58\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u30b5\u30a4\u30ba\u7701\u7565\u306e\u521d\u671f\u5316\u300cchar str[] = \"Hello\";\u300d\u3092\u4f7f\u3048\u3070\u30b3\u30f3\u30d1\u30a4\u30e9\u304c\u81ea\u52d5\u8a08\u7b97\u3059\u308b\u305f\u3081\u3001\u3053\u306e\u7a2e\u306e\u30d0\u30b0\u3092\u9632\u3052\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u30d0\u30b0\u30d1\u30bf\u30fc\u30f32\uff1astrcat\u3067\u30d0\u30c3\u30d5\u30a1\u30aa\u30fc\u30d0\u30fc\u30d5\u30ed\u30fc<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">strcat\u306f\u9023\u7d50\u5148\u306e\u914d\u5217\u306b\u5341\u5206\u306a\u30b9\u30da\u30fc\u30b9\u304c\u3042\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u305b\u3093\u3002\u300cchar str[10] = \"Hello\";\u300d\u306b\u3055\u3089\u306b\u9577\u3044\u6587\u5b57\u5217\u3092strcat\u3067\u9023\u7d50\u3059\u308b\u3068\u3001\u914d\u5217\u306e\u7bc4\u56f2\u3092\u8d85\u3048\u3066\u30e1\u30e2\u30ea\u3092\u4e0a\u66f8\u304d\u3057\u307e\u3059\u3002\u3053\u308c\u306f\u30d0\u30c3\u30d5\u30a1\u30aa\u30fc\u30d0\u30fc\u30d5\u30ed\u30fc\u8106\u5f31\u6027\u306e\u5178\u578b\u7684\u306a\u539f\u56e0\u3067\u3001\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u4e0a\u306e\u91cd\u5927\u306a\u30ea\u30b9\u30af\u306b\u306a\u308a\u307e\u3059\u3002\u5bfe\u7b56\u306fstrncat\u95a2\u6570\uff08\u9023\u7d50\u3059\u308b\u6700\u5927\u6587\u5b57\u6570\u3092\u6307\u5b9a\u3067\u304d\u308b\uff09\u3092\u4f7f\u3046\u304b\u3001\u9023\u7d50\u524d\u306b\u9023\u7d50\u5f8c\u306e\u9577\u3055\u304c\u30d0\u30c3\u30d5\u30a1\u306b\u53ce\u307e\u308b\u304b\u78ba\u8a8d\u3059\u308b\u3053\u3068\u3067\u3059\u3002\u5177\u4f53\u7684\u306b\u306f\u300cstrlen(dst) + strlen(src) + 1 &lt;= sizeof(dst)\u300d\u304c\u6210\u308a\u7acb\u3064\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u304b\u3089strcat\u3092\u547c\u3073\u51fa\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u30d0\u30b0\u30d1\u30bf\u30fc\u30f33\uff1a\u7d42\u7aef\u6587\u5b57\u304c\u4ed8\u304b\u306a\u3044\u72b6\u614b\u3067\u6587\u5b57\u5217\u95a2\u6570\u3092\u547c\u3076<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">char\u914d\u5217\u3092\u300cchar buf[10];\u300d\u3068\u5ba3\u8a00\u3059\u308b\u3060\u3051\u3067\u521d\u671f\u5316\u3057\u306a\u3044\u5834\u5408\u3001\u914d\u5217\u306e\u4e2d\u8eab\u306f\u4e0d\u5b9a\u5024\uff08\u30b4\u30df\u30c7\u30fc\u30bf\uff09\u3067\u3059\u3002\u3053\u306e\u72b6\u614b\u3067strlen\u3084printf\u3092\u547c\u3076\u3068\u3001\u7d42\u7aef\u6587\u5b57\uff08\\0\uff09\u304c\u898b\u3064\u304b\u308b\u307e\u3067\u914d\u5217\u306e\u7bc4\u56f2\u3092\u8d85\u3048\u3066\u30e1\u30e2\u30ea\u3092\u8aad\u307f\u7d9a\u3051\u3001\u8aa4\u3063\u305f\u9577\u3055\u3092\u8fd4\u3059\u304b\u3001\u6700\u60aa\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u30af\u30e9\u30c3\u30b7\u30e5\u3057\u307e\u3059\u3002\u5bfe\u7b56\u306f\u300cchar buf[10] = {0};\u300d\u3068\u30bc\u30ed\u521d\u671f\u5316\u3059\u308b\u304b\u3001\u30c7\u30fc\u30bf\u3092\u66f8\u304d\u8fbc\u3080\u524d\u306b\u5fc5\u305a\u7d42\u7aef\u6587\u5b57\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u3067\u3059\u3002strncpy\u3092\u4f7f\u3046\u5834\u5408\u3082\u300cdst[sizeof(dst)-1] = '\\0';\u300d\u3068\u660e\u793a\u7684\u306b\u7d42\u7aef\u6587\u5b57\u3092\u8a2d\u5b9a\u3059\u308b\u7fd2\u6163\u3092\u3064\u3051\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u30d0\u30b0\u30d1\u30bf\u30fc\u30f34\uff1a\u30eb\u30fc\u30d7\u3067char\u914d\u5217\u3092\u8d8a\u3048\u3066\u66f8\u304d\u8fbc\u3080<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u30e6\u30fc\u30b6\u30fc\u304b\u3089\u306e\u5165\u529b\u3092char\u914d\u5217\u306b\u683c\u7d0d\u3059\u308b\u3068\u304d\u3001\u300cscanf(\"%s\", str);\u300d\u3092\u4f7f\u3046\u3068\u5165\u529b\u6587\u5b57\u6570\u306b\u95a2\u4fc2\u306a\u304f\u914d\u5217\u306b\u66f8\u304d\u8fbc\u307f\u7d9a\u3051\u307e\u3059\u3002\u5165\u529b\u304c\u914d\u5217\u30b5\u30a4\u30ba\u3092\u8d85\u3048\u308b\u3068\u30d0\u30c3\u30d5\u30a1\u30aa\u30fc\u30d0\u30fc\u30d5\u30ed\u30fc\u304c\u8d77\u304d\u307e\u3059\u3002\u5b89\u5168\u306a\u5165\u529b\u306b\u306f\u300cscanf(\"%9s\", str);\u300d\u306e\u3088\u3046\u306b\u6700\u5927\u6587\u5b57\u6570\u3092\u6307\u5b9a\u3059\u308b\u304b\u3001\u300cfgets(str, sizeof(str), stdin);\u300d\u3092\u4f7f\u3046\u3053\u3068\u304c\u63a8\u5968\u3055\u308c\u307e\u3059\u3002fgets\u306f\u6307\u5b9a\u30d0\u30a4\u30c8\u6570\u3092\u8d85\u3048\u3066\u8aad\u307f\u8fbc\u307e\u306a\u3044\u305f\u3081\u3001\u5165\u529b\u306e\u9577\u3055\u306b\u95a2\u4fc2\u306a\u304f\u5b89\u5168\u306b\u4f7f\u3048\u307e\u3059\u3002<\/p>\n\n\n\n<h3 style=\"font-size:18px;font-weight:700;margin:32px 0 16px;padding-left:12px;border-left:4px solid #059669;\">\u6587\u5b57\u30fb\u6587\u5b57\u5217\u51e6\u7406\u306e\u5b9f\u8df5\u30d1\u30bf\u30fc\u30f3\u96c6<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b9f\u52d9\u3067\u3088\u304f\u4f7f\u3046C\u8a00\u8a9e\u306e\u6587\u5b57\u5217\u51e6\u7406\u30d1\u30bf\u30fc\u30f3\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u30d1\u30bf\u30fc\u30f3\u3092\u30d9\u30fc\u30b9\u306b\u3059\u308b\u3053\u3068\u3067\u3001\u591a\u304f\u306e\u6587\u5b57\u5217\u51e6\u7406\u8ab2\u984c\u306b\u5bfe\u5fdc\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u30d1\u30bf\u30fc\u30f31\uff1a\u6587\u5b57\u5217\u3092\u5927\u6587\u5b57\u30fb\u5c0f\u6587\u5b57\u5909\u63db\u3059\u308b<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">ctype.h\u306etoupper\u30fbtolower\u95a2\u6570\u3092\u4f7f\u3044\u3001\u30eb\u30fc\u30d7\u30671\u6587\u5b57\u305a\u3064\u5909\u63db\u3057\u307e\u3059\u3002\u6587\u5b57\u5217\u5168\u4f53\u3092\u5909\u63db\u3059\u308b\u95a2\u6570\u306fC\u6a19\u6e96\u30e9\u30a4\u30d6\u30e9\u30ea\u306b\u306f\u306a\u3044\u305f\u3081\u3001\u81ea\u5206\u3067\u30eb\u30fc\u30d7\u3092\u66f8\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u300cfor (i = 0; str[i] != '\\0'; i++) { str[i] = toupper(str[i]); }\u300d\u306e\u3088\u3046\u306b\u3057\u3066\u5168\u6587\u5b57\u3092\u5909\u63db\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u30d1\u30bf\u30fc\u30f32\uff1a\u6587\u5b57\u5217\u304b\u3089\u7279\u5b9a\u306e\u6587\u5b57\u3092\u691c\u7d22\u3059\u308b<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">string.h\u306estrchr\u95a2\u6570\u306f\u6587\u5b57\u5217\u4e2d\u304b\u3089\u7279\u5b9a\u306e\u6587\u5b57\u3092\u691c\u7d22\u3057\u3001\u6700\u521d\u306b\u898b\u3064\u304b\u3063\u305f\u4f4d\u7f6e\u3078\u306e\u30dd\u30a4\u30f3\u30bf\u3092\u8fd4\u3057\u307e\u3059\u3002strstr\u95a2\u6570\u306f\u6587\u5b57\u5217\u4e2d\u304b\u3089\u90e8\u5206\u6587\u5b57\u5217\u3092\u691c\u7d22\u3057\u307e\u3059\u3002\u300cchar *p = strchr(str, 'A');\u300d\u3067str\u4e2d\u306b'A'\u304c\u5b58\u5728\u3059\u308b\u5834\u5408\u306f\u305d\u306e\u30a2\u30c9\u30ec\u30b9\u3092\u3001\u5b58\u5728\u3057\u306a\u3044\u5834\u5408\u306fNULL\u3092\u8fd4\u3057\u307e\u3059\u3002NULL\u30c1\u30a7\u30c3\u30af\u3092\u3057\u3066\u304b\u3089\u4f7f\u3046\u306e\u304c\u5b89\u5168\u306a\u4f7f\u3044\u65b9\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u30d1\u30bf\u30fc\u30f33\uff1a\u6587\u5b57\u5217\u3092\u6570\u5024\u306b\u5909\u63db\u3059\u308b<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">stdlib.h\u306eatoi\uff08\u6587\u5b57\u5217\u2192int\uff09\u30fbatof\uff08\u6587\u5b57\u5217\u2192double\uff09\u30fbstrtol\uff08\u9577\u6574\u6570\u30fb\u57fa\u6570\u6307\u5b9a\u53ef\uff09\u306a\u3069\u306e\u95a2\u6570\u304c\u4f7f\u3048\u307e\u3059\u3002\u305f\u3060\u3057atoi\u30fbatof\u306f\u5909\u63db\u5931\u6557\u6642\u306b\u30a8\u30e9\u30fc\u3092\u8fd4\u3055\u306a\u3044\u305f\u3081\u3001\u3088\u308a\u5b89\u5168\u306astrtol\u30fbstrtod\u3092\u4f7f\u3046\u3053\u3068\u304c\u63a8\u5968\u3055\u308c\u307e\u3059\u3002strtol\u306f\u5909\u63db\u5f8c\u306e\u6b8b\u308a\u306e\u6587\u5b57\u5217\u3078\u306e\u30dd\u30a4\u30f3\u30bf\u3092\u8fd4\u3059\u305f\u3081\u3001\u5909\u63db\u304c\u6210\u529f\u3057\u305f\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002\u30e6\u30fc\u30b6\u30fc\u304b\u3089\u6570\u5024\u5165\u529b\u3092\u53d7\u3051\u53d6\u308b\u51e6\u7406\u3067\u306f\u5fc5\u305a\u5909\u63db\u306e\u6210\u5426\u30c1\u30a7\u30c3\u30af\u3092\u5165\u308c\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u30d1\u30bf\u30fc\u30f34\uff1a\u6587\u5b57\u5217\u306e\u5148\u982d\u30fb\u672b\u5c3e\u306e\u30b9\u30da\u30fc\u30b9\u3092\u9664\u53bb\u3059\u308b\uff08trim\u306e\u5b9f\u88c5\uff09<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">C\u8a00\u8a9e\u306e\u6a19\u6e96\u30e9\u30a4\u30d6\u30e9\u30ea\u306b\u306ftrim\u95a2\u6570\u304c\u3042\u308a\u307e\u305b\u3093\u3002\u5148\u982d\u306e\u30b9\u30da\u30fc\u30b9\u3092\u9664\u53bb\u3059\u308b\u306b\u306f\u300cwhile (isspace(*p)) p++;\u300d\u3067\u30dd\u30a4\u30f3\u30bf\u3092\u9032\u3081\u3001\u672b\u5c3e\u306e\u30b9\u30da\u30fc\u30b9\u3092\u9664\u53bb\u3059\u308b\u306b\u306f\u672b\u5c3e\u304b\u3089\u7d42\u7aef\u6587\u5b57\u306b\u5411\u304b\u3063\u3066\u691c\u7d22\u3057\u300cstr[i] = '\\0';\u300d\u3068\u7d42\u7aef\u6587\u5b57\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002\u3053\u306e\u51e6\u7406\u306f\u5b9f\u52d9\u3067\u975e\u5e38\u306b\u3088\u304f\u4f7f\u308f\u308c\u308b\u305f\u3081\u3001\u6c4e\u7528trim\u95a2\u6570\u3068\u3057\u3066\u4e00\u5ea6\u5b9f\u88c5\u3057\u3066\u304a\u304f\u3068\u4fbf\u5229\u3067\u3059\u3002Claude Code\u306b\u300cC\u8a00\u8a9e\u3067trim\u95a2\u6570\u3092\u5b9f\u88c5\u3057\u3066\u300d\u3068\u6307\u793a\u3059\u308c\u3070\u3001\u5b89\u5168\u306a\u5b9f\u88c5\u3092\u5373\u5ea7\u306b\u751f\u6210\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h3 style=\"font-size:18px;font-weight:700;margin:32px 0 16px;padding-left:12px;border-left:4px solid #dc2626;\">C\u8a00\u8a9e\u6587\u5b57\u5217\u51e6\u7406\u306e\u5b66\u7fd2\u30ed\u30fc\u30c9\u30de\u30c3\u30d7<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">C\u8a00\u8a9e\u306echar\u578b\u30fb\u6587\u5b57\u5217\u51e6\u7406\u3092\u7fd2\u5f97\u3059\u308b\u305f\u3081\u306e\u30b9\u30c6\u30c3\u30d7\u3092\u6574\u7406\u3057\u307e\u3059\u3002\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u5b66\u7fd2\u306b\u304a\u3044\u3066\u6587\u5b57\u5217\u51e6\u7406\u306f\u30dd\u30a4\u30f3\u30bf\u3068\u4e26\u3093\u3067\u7406\u89e3\u304c\u96e3\u3057\u3044\u3068\u8a00\u308f\u308c\u307e\u3059\u304c\u3001\u57fa\u790e\u304b\u3089\u9806\u756a\u306b\u7a4d\u307f\u4e0a\u3052\u308c\u3070\u78ba\u5b9f\u306b\u30de\u30b9\u30bf\u30fc\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u30b9\u30c6\u30c3\u30d71\u306fchar\u578b\u306e\u57fa\u790e\u3068\u3057\u3066\u30011\u6587\u5b57\u306e\u683c\u7d0d\u30fbASCII\u5024\u3068\u306e\u95a2\u4fc2\u30fbprintf(\"%c\")\u3067\u306e\u51fa\u529b\u3092\u7406\u89e3\u3057\u307e\u3059\u3002\u30b7\u30f3\u30b0\u30eb\u30af\u30a9\u30fc\u30c8\u3068\u30c0\u30d6\u30eb\u30af\u30a9\u30fc\u30c8\u306e\u9055\u3044\uff08'A'\u306f\u6587\u5b57\u5b9a\u6570\u3067\u502465\u3001\"A\"\u306f\u6587\u5b57\u5217\u30ea\u30c6\u30e9\u30eb\u3067char\u914d\u5217\uff09\u3092\u533a\u5225\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308b\u3053\u3068\u304c\u76ee\u6a19\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u30b9\u30c6\u30c3\u30d72\u306fchar\u914d\u5217\u306b\u3088\u308b\u6587\u5b57\u5217\u51e6\u7406\u3067\u3059\u3002\u7d42\u7aef\u6587\u5b57\uff08\\0\uff09\u306e\u4ed5\u7d44\u307f\u3092\u7406\u89e3\u3057\u3001\u914d\u5217\u30b5\u30a4\u30ba\u306e\u8a08\u7b97\uff08\u6587\u5b57\u6570+1\uff09\u3001char\u914d\u5217\u306e\u521d\u671f\u5316\u3001\u30eb\u30fc\u30d7\u3067\u306e1\u6587\u5b57\u305a\u3064\u306e\u51e6\u7406\u3092\u7fd2\u5f97\u3057\u307e\u3059\u3002\u3053\u306e\u6bb5\u968e\u3067strlen\u30fbstrcpy\u30fbstrcat\u30fbstrcmp\u3092\u4e00\u901a\u308a\u52d5\u304b\u3057\u3066\u52d5\u4f5c\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u30b9\u30c6\u30c3\u30d73\u306fchar*\uff08\u30dd\u30a4\u30f3\u30bf\uff09\u3068\u306e\u4f7f\u3044\u5206\u3051\u3067\u3059\u3002\u914d\u5217\u3068\u30dd\u30a4\u30f3\u30bf\u306e\u9055\u3044\uff08sizeof\u306e\u52d5\u4f5c\u30fb\u66f8\u304d\u63db\u3048\u53ef\u80fd\u304b\u3069\u3046\u304b\uff09\u3092\u7406\u89e3\u3057\u3001\u95a2\u6570\u5f15\u6570\u3067char*\u3092\u4f7f\u3046\u5834\u9762\uff08\u6587\u5b57\u5217\u3092\u53d7\u3051\u53d6\u308b\u95a2\u6570\u306e\u8a2d\u8a08\uff09\u3092\u5b66\u3073\u307e\u3059\u3002\u30dd\u30a4\u30f3\u30bf\u306e\u6982\u5ff5\u306f\u96e3\u3057\u3044\u3067\u3059\u304c\u3001\u6587\u5b57\u5217\u51e6\u7406\u306b\u304a\u3051\u308b\u300c\u914d\u5217\u540d\u306f\u30dd\u30a4\u30f3\u30bf\u3068\u540c\u3058\u3088\u3046\u306b\u4f7f\u3048\u308b\u300d\u3068\u3044\u3046\u539f\u5247\u3092\u7406\u89e3\u3059\u308c\u3070\u5fdc\u7528\u304c\u5e83\u304c\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u30b9\u30c6\u30c3\u30d74\u306f\u5b89\u5168\u306a\u6587\u5b57\u5217\u51e6\u7406\u3067\u3059\u3002\u30d0\u30c3\u30d5\u30a1\u30aa\u30fc\u30d0\u30fc\u30d5\u30ed\u30fc\u5bfe\u7b56\uff08strncpy\u30fbfgets\u30fbsnprintf\u306e\u4f7f\u3044\u65b9\uff09\u3001\u52d5\u7684\u30e1\u30e2\u30ea\u78ba\u4fdd\uff08malloc\u30fbfree\u3092\u4f7f\u3063\u305f\u53ef\u5909\u9577\u6587\u5b57\u5217\u51e6\u7406\uff09\u3092\u7fd2\u5f97\u3057\u307e\u3059\u3002\u3053\u306e\u6bb5\u968e\u3067Claude Code\u3068\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u3067\u3001\u8907\u96d1\u306a\u6587\u5b57\u5217\u51e6\u7406\u3082\u52b9\u7387\u3088\u304f\u5b9f\u88c5\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h3 style=\"font-size:18px;font-weight:700;margin:32px 0 16px;padding-left:12px;border-left:4px solid #1e3a5f;\">C\u8a00\u8a9e\u306echar\u578b\u3068\u4ed6\u306e\u8a00\u8a9e\u306e\u6587\u5b57\u5217\u578b\u306e\u9055\u3044\u3092\u7406\u89e3\u3059\u308b<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">C\u8a00\u8a9e\u3092\u5b66\u3076\u306b\u3042\u305f\u3063\u3066\u3001Python\u3084Java\u306a\u3069\u4ed6\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3092\u77e5\u3063\u3066\u3044\u308b\u4eba\u304c\u3064\u307e\u305a\u304d\u3084\u3059\u3044\u70b9\u304c\u300c\u6587\u5b57\u5217\u578b\u304c\u306a\u3044\u300d\u3068\u3044\u3046\u4e8b\u5b9f\u3067\u3059\u3002Python\u306b\u306fstr\u304c\u3042\u308aJava\u306b\u306fString\u30af\u30e9\u30b9\u304c\u3042\u308a\u307e\u3059\u304c\u3001C\u8a00\u8a9e\u306b\u306f\u6587\u5b57\u5217\u5c02\u7528\u306e\u578b\u304c\u306a\u304f\u3001char\u914d\u5217\u3092\u4f7f\u3063\u3066\u624b\u52d5\u3067\u7ba1\u7406\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Python\u306a\u3089\u300cs1 + s2\u300d\u3067\u6587\u5b57\u5217\u3092\u9023\u7d50\u3067\u304d\u307e\u3059\u304c\u3001C\u8a00\u8a9e\u3067\u306fstrcat\u3092\u4f7f\u3044\u3001\u30b3\u30d4\u30fc\u5148\u306b\u5341\u5206\u306a\u30b9\u30da\u30fc\u30b9\u304c\u3042\u308b\u3053\u3068\u3092\u81ea\u5206\u3067\u78ba\u8a8d\u3057\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002Java\u306a\u3089\u300cs1.equals(s2)\u300d\u3067\u6587\u5b57\u5217\u3092\u6bd4\u8f03\u3067\u304d\u307e\u3059\u304c\u3001C\u8a00\u8a9e\u3067\u306fstrcmp\u3092\u4f7f\u3044\u3001\u623b\u308a\u5024\u304c0\u304b\u3069\u3046\u304b\u3067\u5224\u5b9a\u3057\u307e\u3059\u3002\u3053\u306e\u300c\u4f4e\u30ec\u30d9\u30eb\u306a\u624b\u52d5\u7ba1\u7406\u300d\u304cC\u8a00\u8a9e\u306e\u6587\u5b57\u5217\u51e6\u7406\u3092\u96e3\u3057\u304f\u3057\u3066\u3044\u308b\u8981\u56e0\u3067\u3059\u304c\u3001\u88cf\u3092\u8fd4\u305b\u3070\u30e1\u30e2\u30ea\u306e\u4ed5\u7d44\u307f\u3092\u6df1\u304f\u7406\u89e3\u3067\u304d\u308b\u5b66\u7fd2\u6a5f\u4f1a\u3067\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">C\u8a00\u8a9e\u3067char\u914d\u5217\u30fb\u30dd\u30a4\u30f3\u30bf\u30fb\u6587\u5b57\u5217\u95a2\u6570\u3092\u4f7f\u3044\u3053\u306a\u3059\u3053\u3068\u3067\u3001\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u304c\u30e1\u30e2\u30ea\u4e0a\u3067\u30c7\u30fc\u30bf\u3092\u3069\u3046\u6271\u3063\u3066\u3044\u308b\u304b\u306e\u7406\u89e3\u304c\u6df1\u307e\u308a\u307e\u3059\u3002\u3053\u306e\u77e5\u8b58\u306fC++\u3001\u7d44\u307f\u8fbc\u307f\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3001OS\u958b\u767a\u306a\u3069\u3001\u3088\u308a\u5c02\u9580\u7684\u306a\u5206\u91ce\u3067\u3082\u76f4\u63a5\u6d3b\u304d\u307e\u3059\u3002C\u8a00\u8a9e\u306e\u6587\u5b57\u5217\u51e6\u7406\u306f\u6700\u521d\u306f\u96e3\u3057\u304f\u611f\u3058\u307e\u3059\u304c\u3001\u57fa\u672c\u3092\u3057\u3063\u304b\u308a\u62bc\u3055\u3048\u3066Claude Code\u3092\u88dc\u52a9\u30c4\u30fc\u30eb\u3068\u3057\u3066\u6d3b\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u52b9\u7387\u3088\u304f\u7fd2\u5f97\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">char\u578b\u30fb\u6587\u5b57\u5217\u306e\u7406\u89e3\u306fC\u8a00\u8a9e\u306e\u6838\u5fc3\u90e8\u5206\u3067\u3059\u3002strlen\u30fbstrcpy\u30fbstrcat\u30fbstrcmp\u306e4\u3064\u306e\u6a19\u6e96\u95a2\u6570\u3092\u4f7f\u3044\u3053\u306a\u3057\u3001\u30d0\u30c3\u30d5\u30a1\u30aa\u30fc\u30d0\u30fc\u30d5\u30ed\u30fc\u5bfe\u7b56\uff08strncpy\u30fbfgets\uff09\u3092\u7fd2\u6163\u5316\u3059\u308b\u3053\u3068\u3067\u3001\u5b9f\u52d9\u30ec\u30d9\u30eb\u306eC\u8a00\u8a9e\u6587\u5b57\u5217\u51e6\u7406\u306b\u5bfe\u5fdc\u3067\u304d\u307e\u3059\u3002Claude Code\u3092\u4f7f\u3048\u3070\u30b3\u30fc\u30c9\u306e\u96db\u5f62\u751f\u6210\u304b\u3089\u554f\u984c\u306e\u89e3\u8aac\u307e\u3067\u3001\u5b66\u7fd2\u306e\u3042\u3089\u3086\u308b\u5834\u9762\u3067\u30b5\u30dd\u30fc\u30c8\u3092\u53d7\u3051\u3089\u308c\u307e\u3059\u3002\u305c\u3072\u7a4d\u6975\u7684\u306b\u6d3b\u7528\u3057\u3066C\u8a00\u8a9e\u306e\u6587\u5b57\u5217\u51e6\u7406\u3092\u30de\u30b9\u30bf\u30fc\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6700\u5f8c\u306bC\u8a00\u8a9e\u306echar\u578b\u30fb\u6587\u5b57\u5217\u51e6\u7406\u3067\u899a\u3048\u3066\u304a\u304f\u3079\u304d\u30dd\u30a4\u30f3\u30c8\u3092\u6574\u7406\u3057\u307e\u3059\u3002char\u578b\u306f1\u6587\u5b57\u3092\u683c\u7d0d\u3059\u308b\u30c7\u30fc\u30bf\u578b\u3067\u3001\u5185\u90e8\u7684\u306b\u306fASCII\u5024\u306a\u3069\u306e\u6570\u5024\u3092\u4fdd\u6301\u3057\u307e\u3059\u3002\u6587\u5b57\u5217\u306fchar\u914d\u5217\u3067\u8868\u73fe\u3057\u3001\u5fc5\u305a\u672b\u5c3e\u306b\u7d42\u7aef\u6587\u5b57\uff08\\0\uff09\u304c\u4ed8\u304d\u307e\u3059\u3002\u6587\u5b57\u5217\u306e\u30b3\u30d4\u30fc\u306b\u306fstrcpy\u30fbstrncpy\u3001\u9023\u7d50\u306b\u306fstrcat\u3001\u9577\u3055\u306e\u53d6\u5f97\u306b\u306fstrlen\u3001\u6bd4\u8f03\u306b\u306fstrcmp\u3092\u4f7f\u3044\u307e\u3059\u3002\u7b49\u53f7\u6f14\u7b97\u5b50\uff08==\uff09\u306b\u3088\u308b\u6587\u5b57\u5217\u6bd4\u8f03\u306f\u30a2\u30c9\u30ec\u30b9\u6bd4\u8f03\u306b\u306a\u308b\u305f\u3081\u4f7f\u3063\u3066\u306f\u3044\u3051\u307e\u305b\u3093\u3002char*\u30dd\u30a4\u30f3\u30bf\u306f\u6587\u5b57\u5217\u30ea\u30c6\u30e9\u30eb\u3092\u76f4\u63a5\u6307\u3059\u5834\u5408\u3001\u5185\u5bb9\u3092\u66f8\u304d\u63db\u3048\u308b\u3068\u30bb\u30b0\u30e1\u30f3\u30c6\u30fc\u30b7\u30e7\u30f3\u9055\u53cd\u304c\u8d77\u304d\u307e\u3059\u3002\u66f8\u304d\u63db\u3048\u304c\u5fc5\u8981\u306a\u5834\u5408\u306fchar\u914d\u5217\u3092\u4f7f\u3063\u3066\u304f\u3060\u3055\u3044\u3002\u30d0\u30c3\u30d5\u30a1\u30aa\u30fc\u30d0\u30fc\u30d5\u30ed\u30fc\u5bfe\u7b56\u3068\u3057\u3066\u3001\u6587\u5b57\u5217\u306e\u30b3\u30d4\u30fc\u3084\u5165\u529b\u53d7\u3051\u53d6\u308a\u306b\u306f\u5e38\u306b\u30b5\u30a4\u30ba\u5236\u9650\u4ed8\u304d\u306e\u95a2\u6570\uff08strncpy\u30fbfgets\uff09\u3092\u4f7f\u3046\u7fd2\u6163\u3092\u3064\u3051\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u308c\u3089\u306e\u57fa\u672c\u3092\u3057\u3063\u304b\u308a\u7406\u89e3\u3057\u305f\u4e0a\u3067Claude Code\u3092\u6d3b\u7528\u3059\u308b\u3053\u3068\u3067\u3001C\u8a00\u8a9e\u306e\u6587\u5b57\u5217\u51e6\u7406\u3092\u52b9\u7387\u3088\u304f\u7fd2\u5f97\u3057\u3001\u5b9f\u969b\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u958b\u767a\u306b\u5fdc\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">C\u8a00\u8a9e\u306echar\u578b\u3068\u6587\u5b57\u5217\u51e6\u7406\u306f\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u57fa\u790e\u529b\u3092\u5927\u304d\u304f\u5de6\u53f3\u3059\u308b\u91cd\u8981\u306a\u30c6\u30fc\u30de\u3067\u3059\u3002\u914d\u5217\u306e\u30b5\u30a4\u30ba\u7ba1\u7406\u3001\u7d42\u7aef\u6587\u5b57\u306e\u6271\u3044\u3001\u30dd\u30a4\u30f3\u30bf\u3068\u306e\u95a2\u4fc2\u306a\u3069\u899a\u3048\u308b\u3053\u3068\u306f\u591a\u3044\u3067\u3059\u304c\u3001\u4e00\u3064\u3072\u3068\u3064\u4e01\u5be7\u306b\u78ba\u8a8d\u3057\u306a\u304c\u3089\u5b9f\u88c5\u3092\u91cd\u306d\u308b\u3053\u3068\u3067\u78ba\u5b9f\u306b\u8eab\u306b\u3064\u304d\u307e\u3059\u3002\u7279\u306b\u7d42\u7aef\u6587\u5b57\u306e\u6271\u3044\u3068\u30d0\u30c3\u30d5\u30a1\u30aa\u30fc\u30d0\u30fc\u30d5\u30ed\u30fc\u5bfe\u7b56\u306f\u3001C\u8a00\u8a9e\u3092\u4f7f\u3046\u9650\u308a\u5e38\u306b\u610f\u8b58\u3059\u3079\u304d\u57fa\u672c\u539f\u5247\u3067\u3059\u3002Claude Code\u306b\u6587\u5b57\u5217\u51e6\u7406\u306e\u8ab2\u984c\u3092\u89e3\u304b\u305b\u3066\u305d\u306e\u30b3\u30fc\u30c9\u3092\u8aad\u307f\u89e3\u304f\u5b66\u7fd2\u6cd5\u306f\u3001\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u5b66\u7fd2\u306e\u52b9\u7387\u3092\u5927\u5e45\u306b\u9ad8\u3081\u307e\u3059\u3002\u81ea\u5206\u3067\u30b3\u30fc\u30c9\u3092\u66f8\u304d\u3001\u7591\u554f\u70b9\u3092Claude Code\u306b\u8cea\u554f\u3057\u3001\u751f\u6210\u3055\u308c\u305f\u30b3\u30fc\u30c9\u3068\u6bd4\u8f03\u3059\u308b\u3053\u3068\u3067\u3001\u7406\u89e3\u304c\u6df1\u307e\u308a\u307e\u3059\u3002char\u578b\u30fb\u6587\u5b57\u5217\u51e6\u7406\u306e\u57fa\u790e\u3092\u56fa\u3081\u3066\u3001C\u8a00\u8a9e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u6b21\u306e\u30b9\u30c6\u30c3\u30d7\u3078\u9032\u3093\u3067\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">C\u8a00\u8a9e\u306echar\u578b\u3068\u6587\u5b57\u5217\u306f\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u6839\u5e79\u3092\u306a\u3059\u30c6\u30fc\u30de\u3067\u3059\u3002strlen\u30fbstrcpy\u30fbstrcat\u30fbstrcmp\u306e\u4f7f\u3044\u65b9\u3068\u7d42\u7aef\u6587\u5b57\u306e\u4ed5\u7d44\u307f\u3092\u6b63\u78ba\u306b\u7406\u89e3\u3059\u308b\u3053\u3068\u304c\u3001C\u8a00\u8a9e\u30d7\u30ed\u30b0\u30e9\u30de\u3068\u3057\u3066\u306e\u7b2c\u4e00\u6b69\u3067\u3059\u3002\u30d0\u30c3\u30d5\u30a1\u30aa\u30fc\u30d0\u30fc\u30d5\u30ed\u30fc\u5bfe\u7b56\u3092\u5e38\u306b\u610f\u8b58\u3057\u3001\u5b89\u5168\u306a\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u7fd2\u6163\u3092\u3064\u3051\u308b\u3053\u3068\u3067\u3001\u5b9f\u52d9\u3067\u4f7f\u3048\u308bC\u8a00\u8a9e\u30b9\u30ad\u30eb\u304c\u8eab\u306b\u3064\u304d\u307e\u3059\u3002<\/p>\n\n\n","protected":false},"excerpt":{"rendered":"<p>C\u8a00\u8a9e\u306echar\u578b\uff08\u6587\u5b57\u30fb\u6587\u5b57\u5217\uff09\u306e\u4f7f\u3044\u65b9\u3092\u5b8c\u5168\u89e3\u8aac\u3002char\u914d\u5217\u3068\u30dd\u30a4\u30f3\u30bf\u306e\u9055\u3044\u3001\u7d42\u7aef\u6587\u5b57\\0\u306e\u4ed5\u7d44\u307f\u3001strlen\u30fbstrcpy\u30fbstrcat\u30fbstrcmp\u306a\u3069\u306e\u6587\u5b57\u5217\u95a2\u6570\u306e\u4f7f\u3044\u65b9\u3001Claude Code\u306b\u3088\u308b\u81ea\u52d5\u751f\u6210\u307e\u3067\u5b9f\u8df5\u7684\u306b\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":17981,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"sitemap_hide":"","_veu_custom_css":"","vkexunit_cta_each_option":"","footnotes":"","rank_math_description":"C\u8a00\u8a9e\u306echar\u578b\uff08\u6587\u5b57\u30fb\u6587\u5b57\u5217\uff09\u306e\u4f7f\u3044\u65b9\u3092\u5b8c\u5168\u89e3\u8aac\u3002char\u914d\u5217\u3068\u30dd\u30a4\u30f3\u30bf\u306e\u9055\u3044\u3001\u7d42\u7aef\u6587\u5b57\\0\u306e\u4ed5\u7d44\u307f\u3001strlen\u30fbstrcpy\u30fbstrcat\u30fbstrcmp\u306a\u3069\u306e\u6587\u5b57\u5217\u95a2\u6570\u306e\u4f7f\u3044\u65b9\u3001Claude Code\u306b\u3088\u308b\u81ea\u52d5\u751f\u6210\u307e\u3067\u5b9f\u8df5\u7684\u306b\u7d39\u4ecb\u3057\u307e\u3059\u3002","rank_math_focus_keyword":"C\u8a00\u8a9e char \u6587\u5b57\u5217","rank_math_title":"C\u8a00\u8a9e\u306echar\u578b\u30fb\u6587\u5b57\u5217\u5b8c\u5168\u89e3\u8aac\uff5c\u914d\u5217\u30fb\u30dd\u30a4\u30f3\u30bf\u30fbstrlen\u30fbstrcpy\u306e\u4f7f\u3044\u65b9","pending_rewrite_html":"","pending_rewrite_id":"","pending_rewrite_kw":"","pending_rewrite_at":"","pending_rewrite_source":"","pending_rewrite_brief":"","pending_rewrite_evidence":"","approved_rewrite_html":"","approved_rewrite_id":"","approved_rewrite_kw":"","approved_rewrite_at":"","approved_rewrite_by":"","approved_rewrite_brief":"","approved_rewrite_evidence":"","rewrite_tracker_baseline":"","rewrite_tracker_7day":"","rewrite_tracker_14day":"","rewrite_tracker_30day":"","rewrite_tracker_notified":""},"categories":[2],"tags":[],"class_list":["post-17982","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-claude-tips"],"_links":{"self":[{"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/posts\/17982","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/comments?post=17982"}],"version-history":[{"count":6,"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/posts\/17982\/revisions"}],"predecessor-version":[{"id":17988,"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/posts\/17982\/revisions\/17988"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/media\/17981"}],"wp:attachment":[{"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/media?parent=17982"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/categories?post=17982"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/tags?post=17982"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}