掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
StrDispose(P); で無効なポインタ操作の実行エラー (ID:34163)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
> 添え字を使った場合は、Pの値をカエルことはないだろ? 返事が遅くなりました。そのとおりですね。 出張先でDelphiがないので確認できないのですが、こんな感じかな? function SpcToZen(S: string): string; var i: Integer; P, Pe: PChar; begin if S = '' then Exit; Result := ''; i := 1; P := PChar(S); //先頭 Inc(P, Strlen(P)); //末端 Pe := P; //末端を記憶 P := PChar(S); //先頭に戻す while P <= Pe do begin if (S[i] = #$20) and (S[i+1] = #$20) then begin Result := Result+#$81+#$40; Inc(P); Inc(i); end else Result := Result+P^; Inc(i); Inc(P); end; end;
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.