LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Check to see if a string is "close enough" to what is expected


@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:

l.png


Is there a '+1' missing between the control 'n' and the 'N' terminal of the for loop?


Yes.  Good catch.

l2.png

0 Kudos
Message 11 of 13
(286 Views)

@paul_a_cardinale wrote:
Yes.  Good catch.
l2.png

These off-by-one errors are very common, but fortunately typically easy to detect. 😄

0 Kudos
Message 12 of 13
(278 Views)

It's like they always say; there are only two hard problems in computer science- cache invalidation, naming things, and off-by-one errors.

Message 13 of 13
(258 Views)