Sizeof array in processing

Try:-

sizeof(val) / sizeof(val[0])

(Braces around the parameter.)