Code Comments
Programming Forum and web based access to our favorite programming groups.Is there any ambiguity in the following? while (k < j) print B[++k] Is it possible that k will be incremented before the while loop is checked? -- Regards, ---Robert
Post Follow-up to this messageIn article <C1dod.3295$pX.2941@news.cpqcorp.net>,
Robert Katz <katz@hp.com> wrote:
> Is there any ambiguity in the following?
>
> while (k < j) print B[++k]
>
> Is it possible that k will be incremented before the while loop is checked?[/color
]
It should not. Yours should be no difference than
while (k < j)
print B[++k]
or
while (k < j) {
print B[++k]
}
If ++K happens before k < j then it should be wrong.
Bob Harris
Post Follow-up to this messageRobert Katz <katz@hp.com> wrote > Is there any ambiguity in the following? > > while (k < j) print B[++k] > > Is it possible that k will be incremented before the while loop is checked?[/color ] No.
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.