Originally posted by sasguru
View Post
- Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
- Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!
Monday's fascinating C# quiz
Collapse
X
-
It's thanks to the degree I did do, that I know how much of a cretin you really are.merely at clientco for the entertainment -
Quiz Part II
If
What doesCode:static Func<int> Wibble() { int myValue = 0; return () => myValue++; } static void Main() { Func<int> wibble= Wibble(); Console.WriteLine (wibble()); // Prints 0 Console.WriteLine (wibble()); // Prints 1 }
print?Code:static Func<int> Wibble() { return() => { int myValue= 0; return myValue++; }; } static void Main() { Func<int> wibble= Wibble(); Console.WriteLine (wibble()); // Prints? Console.WriteLine (wibble()); // Prints?Comment
-
You're stupid enough to think a degree you did helps you understand people?Originally posted by eek View PostIt's thanks to the degree I did do, that I know how much of a cretin you really are.


You'd better hope that little business you've got succeeds, because there's no way you're getting to the top otherwise.


Feck me what has the country done to its education system, that it churns out such imbeciles ?
Hard Brexit now!
#prayfornodealComment
-
1Originally posted by DimPrawn View PostIf
What doesCode:static Func<int> Wibble() { int myValue = 0; return () => myValue++; } static void Main() { Func<int> wibble= Wibble(); Console.WriteLine (wibble()); // Prints 0 Console.WriteLine (wibble()); // Prints 1 }
print?Code:static Func<int> Wibble() { return() => { int myValue= 0; return myValue++; }; } static void Main() { Func<int> wibble= Wibble(); Console.WriteLine (wibble()); // Prints? Console.WriteLine (wibble()); // Prints?
2Knock first as I might be balancing my chakras.Comment
-
Nope.Originally posted by suityou01 View Post1
2
You clearly don't undertand closures and capturing.Comment
-
Yep, that's fair. I'm baffled by Lambda expressions as well.Originally posted by DimPrawn View PostNope.
You clearly don't undertand closures and capturing.
Knock first as I might be balancing my chakras.Comment
-
On reflection, the method takes no arguments, and declares the variable each time setting it to zero so your first example looks wrong to me as how can it ever return anything other than 1?
Just sayin like.
Knock first as I might be balancing my chakras.Comment
-
That's tomorrow's fascinating C# quiz topic.Originally posted by suityou01 View PostYep, that's fair. I'm baffled by Lambda expressions as well.
Comment
-
As I said, closures and capturing.Originally posted by suityou01 View PostOn reflection, the method takes no arguments, and declares the variable each time setting it to zero so your first example looks wrong to me as how can it ever return anything other than 1?
Just sayin like.

PS. It's also clear you don't know the difference between ++X and X++Comment
-
Make for incomprehensible code by the looks of itOriginally posted by DimPrawn View PostAs I said, closures and capturing.

Knock first as I might be balancing my chakras.Comment
- Home
- News & Features
- First Timers
- IR35 / S660 / BN66
- Employee Benefit Trusts
- Agency Workers Regulations
- MSC Legislation
- Limited Companies
- Dividends
- Umbrella Company
- VAT / Flat Rate VAT
- Job News & Guides
- Money News & Guides
- Guide to Contracts
- Successful Contracting
- Contracting Overseas
- Contractor Calculators
- MVL
- Contractor Expenses
Advertisers
Contractor Services
CUK News
- Burnham's housing vision vs. Starmer's home-buying reforms: what it means for your contractor mortgage Today 00:59
- In Khalil v Innovate Transport, a limited company contractor wasn’t a worker and was on £2.30 — not £230 Yesterday 07:58
- Andy Burnham is PM: 5 new IT policies set to shape UK tech and its contractors Jul 20 06:29
- Taxed on money I haven't earned yet? Bold move, HMRC Jul 17 08:36
- The Fair Work Agency has got zero hours in its sights. Do you? Jul 16 08:44
- Cookie Policy Jul 15 11:50
- Cloned again: an umbrella company founder's warning on fraud, JSL and Companies House Jul 15 07:47
- How is JSL bedding in for contractor umbrella companies, 100 days in? Jul 14 07:45
- IT contractor demand cools in June 2026 amid UK heatwave Jul 13 08:18
- How could zero hours contract reform create unexpected problems for contractors? Jul 8 06:40

Comment