0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

c++ builder > Copy() > MaxInt > To guarantee copying to the end of the string or array, use the MaxInt constant as the Count value.

Last updated at Posted at 2015-10-30

function Copy ( Source : string; StartChar, Count : Integer ) : string;

To guarantee copying to the end of the string or array, use the MaxInt constant as the Count value.

endまでのコピーとして MaxIntを使うというのが目を引いた。
このルールはソースを読んだ時に明快だろうか?

const static int kToTheEnd = MaxInt;

なり定義して

Copy(srcStr, 5, kToTheEnd);

のように書いたら明示的だが、これがいいかはわからない。


[公式](http://docwiki.embarcadero.com/RADStudio/XE8/ja/%E3%83%A6%E3%83%BC%E3%83%86%E3%82%A3%E3%83%AA%E3%83%86%E3%82%A3_%E3%82%B3%E3%83%BC%E3%83%89%E3%82%92%E4%BD%9C%E6%88%90%E3%81%99%E3%82%8B%EF%BC%88dbExpress_%E3%83%81%E3%83%A5%E3%83%BC%E3%83%88%E3%83%AA%E3%82%A2%E3%83%AB%EF%BC%89)にもMaxIntを使った例がSubString()に対してある。
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?