Marie Curie Marie Curie - 1 year ago 159
Pascal Question

What's the equivalent for pred and succ in C#?

Pascal is my study language and I am curious whether C# also has the functions


This is what I have done in Pascal that I want to try in C#

// in Pascal:
pred(3) = 2
succ(False) = True
pred('b') = 'a'
type enum = (foo, bar, baz);
succ(bar) = baz; pred(bar) = foo

Is the same code applicable for C#, too? If so, what is the namespace for these functions?

(I searched Google, but couldn't find the answer)

Answer Source

There aren't pred and succ functions in C#. You just write n - 1 or n + 1.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download