Range violation

Timoses timosesu at gmail.com
Fri Nov 24 10:31:40 UTC 2017


On Friday, 24 November 2017 at 09:59:13 UTC, Vino wrote:

> if (args.length < 1 || args.length > 2) {

If args.length is 1 it will call

> string op = args[1];

However, args[1] accesses the second element. Due to above if 
statement args[1] can be called even though only args[0] exists.


More information about the Digitalmars-d-learn mailing list