文字列の仕様を考えれば当然な挙動なのだが、うっかりやってしまった。
文字列の仕様を考えれば当然な挙動なのだが、うっかりやってしまった。
sdim test, 64repeat 8test += "testtest"loopmes "元の文字列サイズ: " + strlen(test)// 64バイトコピーしているはずが、表示は65バイトになるsdim copy, 64 // sdim copy, 64 + 1 とすべき(NULL文字の分)memcpy copy, test, 64, 0, 0mes "コピーした文字列サイズ(memcpy): " + strlen(copy)// こっちは平気copy2 = testmes "コピーした文字列サイズ(代入): " + strlen(copy2)