6
Answers

User-defined variable types

Mike Smith

Mike Smith

14y
7.7k
1
A useful construct in Delphi (Object Pascal) is:

type
  TNumColors = 1..256;
var
  numColors: TNumColors;

This defines numColors to a restricted range of integers and allows range checking.

How do you do this in C# please?

Answers (6)