c# - What's the difference between Process[] and Process()[] -
i doing research pattern scanner came problem. the pattern scanner saw needed handler of process way i'm doing process[] p = process.getprocessesbyname("pname"); doesn't have p.handle , went msdn there says have. why mine doesn't? what difference between 2 lines of code? process p = process.getprocessesbyname("pname")[0]; process[] p = process.getprocessesbyname("pname"); this gets first process has name of "pname": process p = process.getprocessesbyname("pname")[0]; note cause "index out of bounds" exception if there aren't any. this gets list (or array, actually) of processes have name of "pname": process[] p = process.getprocessesbyname("pname"); note won't cause exception if there aren't any; it'll return empty array. with latter, can index former, if want first match: process[] p = process.getprocessesbyname("pname"); if (p.len...