Web Log di Adrian Florea

"You know you've achieved perfection in design, not when you have nothing more to add, but when you have nothing more to take away." Antoine de Saint-Exupery
posts - 440, comments - 2715, trackbacks - 3944

My Links

Archives

Post Categories

Image Galleries

.RO Blogs

.RO People

.RO Sites

Blogs

Furls

Links

vinCitori

Quiz Sharp 19

using System;

struct A
{
}

struct B
{
  public A A;
}

struct C
{
  public A A;
  public int I;
}

class Foo
{
  static unsafe void Main()
  {
    Console.WriteLine("A:{0} B:{1} C:{2}", sizeof(A), sizeof(B), sizeof(C));
    Console.Read();
  }
}

Si compila con "Allow Unsafe Code Blocks = True" se utilizzate VS, oppure "/unsafe" da linea di comando (csc)

Cosa viene visualizzato a console?

  • A. 1 1 8
  • B. 1 2 5
  • C. 0 0 4

Print | posted on sabato 5 giugno 2004 15:50 | Filed Under [ Quiz Sharp ]

Powered by:
Powered By Subtext Powered By ASP.NET