Re: what static fuction mean in c#
- From: "Bill Butler" <qwerty@xxxxxxxx>
- Date: Sat, 15 Oct 2005 13:17:38 GMT
"Guido Stercken-Sorrenti [MVP VC++]" <mspbn@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:%23je1Z2X0FHA.2880@xxxxxxxxxxxxxxxxxxxxxxx
>> when i was usong c++ idont have to put static before tha function that i want
>> to acces but in c# i have to but it .
>
> Well, in both languages you have to declare a member function as static if you want to call that
> function without an instance of the class - it's the same in both languages. In C++, like in C#,
> you need an instance to call a nonstatic member function. I don't see why you think this would be
> different?
>
The difference is that in C++ you can declare functions outside of any class. (like in C)
In C# all functions/methods must be part of a Class.
If you don't declare the method as static it means that it is associated with a particular OBJECT.
If you do declare the method as static it means that it is associated with the CLASS.
Bill
.
- References:
- Re: what static fuction mean in c#
- From: Guido Stercken-Sorrenti [MVP VC++]
- Re: what static fuction mean in c#
- Prev by Date: Re: c# 2.x feature requests
- Next by Date: Re: SQLServer or Access?
- Previous by thread: Re: what static fuction mean in c#
- Next by thread: Re: what static fuction mean in c#
- Index(es):
Relevant Pages
|