06-29-2023 09:36 AM
@UliB wrote:
@paul_a_cardinale wrote:
@Eric1977 wrote:
@Eric1977 wrote:
for (i = 0; i<=n; i++) {
p[i] = i;
}I am not used to Java programming (actually, I've never programmed in it before) but it's just a For Loop incrementing one digit to the p array, correct?
Here's the equivalent LabVIEW code:
Is there a '+1' missing between the control 'n' and the 'N' terminal of the for loop?
Yes. Good catch.
06-29-2023 10:09 AM
@paul_a_cardinale wrote:
Yes. Good catch.
These off-by-one errors are very common, but fortunately typically easy to detect. 😄
06-29-2023 03:44 PM
It's like they always say; there are only two hard problems in computer science- cache invalidation, naming things, and off-by-one errors.