1. Extension method for static method? - CSharp/C#
2. How do I access another type's method from one type's method
ding feng wrote:
> I got this program:
>
> class building{
> ...
> };
>
> class school:public building{
> ...
>
> int getstudentnumber(int m);
> };
>
> class hospital:public building{
> ...
>
> int reportpatientnumber();
> };
>
> int hospital:reportpatientnumber()
> {
> //here I need to call school method getstudentnumber(int m);
A hospital is not a school, so you can't call school's member functions
for a hospital. Or did I misunderstand something?
> }
>
> In hosptial:reportpatientnumber() method, I can't pass anything as a
> parameter, for example, can't pass a school type pointer. The
> parameter lists MUST be empty.
What does the int parameter do?
> Is there an alternative way to do that?
It's hard to tell from the information you provided.
3. Send refrence types by value to a method - CSharp/C#
4. Boxing and Unboxing of Value-Types when passed to a method call
Hi All, First of all I think this is gonna be one of those threads :-) since I have bunch of questions which make this very controversial:-0) Ok,Let's see: I was reading an article that When you pass a Value-Type to method call ,Boxing and Unboxing would happen,Consider the following snippet: int a=1355; myMethod(a); ..... void myMethod(int b); Can somebody describes what exactly happens in the stack and (probably in the heap) when this code is executed? Thanks for your time in advance,I will ask my other questions as we go further with this thread. Cheers, Raza Alirezaei
5. Boxing and Unboxing of Value-Types when passed to a method cal - CSharp/C#
6. method ref to arbitrary value type instance
7. out method and method with return value - CSharp/C#
8. Checking if enum type value contains certain value
Hello, Is there some short-gand way to check if the enum type value contains certain value? Ie, the talk here is about Regex object: Regex re = new Regex(@"pattern", RegexOptions.IgnoreCase | RegexOptions.Multiline); if ((re.Options & RegexOptions.IgnoreCase) == RegexOptions.IgnoreCase) ... do stuff ... This "if" expression is rather lengthy, perhaps there is some shorter way to check wether the value contains one of the ORed enum values? Thanks, Pavils