🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.c
Article #297882

Re: Podprocedury w C#

#297882
From: Wiktor S.
Date: Sun, 07 Aug 2011 20:06
27 lines
1223 bytes
> W C# niestety tak się nie da zrobić.

jako podprocedury można wykorzystać lambdy.


using System;

class Program
{

  static void Main()
  {
     int j = 1;

     Func<int,int,int> podprocedura = (int a, int b)=>
     {
        return a + b + j;
     };

     Console.WriteLine(podprocedura(2,5));
  }

}


-- 
Azarien
Technical Details
Message-ID: <j1mr9a$f1v$1@news.onet.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!news.onet.pl!.POSTED!not-for-mail
References: <op.vzuv96l08x7o78@notebook>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!news.onet.pl!.POSTED!not-for-mail
From: "Wiktor S." <wswiktorSP@Mpoczta.fm>
Newsgroups: pl.comp.lang.c
Subject: Re: Podprocedury w C#
Date: Sun, 7 Aug 2011 22:06:53 +0200
Organization: http://onet.pl
Lines: 28
Message-ID: <j1mr9a$f1v$1@news.onet.pl>
References: <op.vzuv96l08x7o78@notebook>
NNTP-Posting-Host: user-46-113-50-67.play-internet.pl
Mime-Version: 1.0
X-Trace: news.onet.pl 1312747628 15423 46.113.50.67 (7 Aug 2011 20:07:08 GMT)
X-Complaints-To: niusy@onet.pl
NNTP-Posting-Date: Sun, 7 Aug 2011 20:07:08 +0000 (UTC)
In-Reply-To: <op.vzuv96l08x7o78@notebook>
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Windows Mail 6.0.6002.18197
X-MimeOLE: Produced By Microsoft MimeOLE V6.1.7601.17514
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit