I have a multicast delegate question.
This is based on some code in C# In A Nutshell Version 5.
using System;
using System.Collections;
using System.Collections.Generic;
public delegate int Transformer(int x);
class MainClass
{
static int Square(int x) { return x * x; }
static int Cube(int x) { return x * x * x; }
static void Main()
{
Transformer t, q, multi;
t = Square;
q = Cube;
multi = t + q;
for (int i = 1; i < 5; i++)
Console.WriteLine(multi(i));
}
}
The output is from Cube alone. Why does the addition fail?