+ 2

What does this line mean? What for "out size"? The rest is clear)

(! int. TryParse(Console. ReadLine(), out size) || size<1)

15th Nov 2017, 8:55 PM
Đ’Đ°Đ»Đ”Ń€ĐžŃ
Đ’Đ°Đ»Đ”Ń€ĐžŃ - avatar
2 Answers
+ 11
out is used to pass variables by reference (so when the method is done, the variables are still changed). TryParse returns two values. It returns a boolean, for if the parse worked or not. If the parse does work, it also returns the value it just converted (and stores it in the 'out' variable).
15th Nov 2017, 9:05 PM
Tamra
Tamra - avatar
+ 1
size is the name of the variable where the return value from out is stored.
16th Nov 2017, 2:58 AM
stellacaerulea
stellacaerulea - avatar