Search Results

Search found 1 results on 1 pages for 'dekpos'.

Page 1/1 | 1 

  • Accepting a numerical range in a function call

    - by dekpos
    I have encountered two ways of doing it: void foo(int from, int to); /* 'from' inclusive, 'to' exclusive */ void foo(int startIndex, int rangelength); Has one style historically been preferred over the other? If so, was it just a matter of convention or was it due to some deeper underlying reason? I'm currently programming in Java and noticed that the Arrays class uses the former style. The exclusivity of the to argument felt somewhat unintuitive to me, which led me to ask this question.

    Read the article

1