子数整数 pascal 中为什么要有inc(j);
发布网友
发布时间:2022-04-22 07:56
我来回答
共4个回答
热心网友
时间:2023-08-08 06:49
inc(j,k):使j加k的函数,没有k时默认为1.
热心网友
时间:2023-08-08 06:49
为了让j加一
热心网友
时间:2023-08-08 06:50
inc(j)就是’j:=j+1’ 啊 具体看你什么程序吧!!!
热心网友
时间:2023-08-08 06:50
Delphi Information
From System.pas
procere Inc(var X: Integer); overload;
procere Inc(var X: Integer; N: Integer); overload;
Unit: System
Type: procere
Visibility: public
[edit] Description
Increments an ordinal value by 1 or N.
In Delphi code, Inc adds 1 or N to the variable X.
X is a variable of an ordinal type (including Int64) or a pointer type, if the extended syntax is enabled.
N is an integer-type expression.
X increments by 1 or by N, if N is specified; that is, Inc(X) corresponds to the statement X := X + 1, and Inc(X, N) corresponds to the statement X := X + N. On some platforms, Inc may generate optimized code, especially useful in tight loops.
If X is a pointer type, it increments X by N times the size of the type pointed to. Thus, given:
type PMyType = ^TMyType;
and
var P: PMyType;
the statement Inc(P) increments P by SizeOf(TMyType).
Warning: You cannot use Inc on properties, because it modifies the parameter.
Note: Inc(S, I), where S is a ShortInt and I is a number greater than 127 causes an EIntOverFlow exception to be raised, if range and overflow checking are on. In Delphi 1.0, this did not raise an exception.
[edit] See Also
Dec
Pred
Succ
Delphi Intrinsic Routines