0
What is the difference between static method and member function?
All the class objects are going to use the member function only .Unlike Member variables , separate memory space for each member function are not allocated for each objects and all objects are going to share them.So apart from invoking (class.function and obj.function) what is the real difference between them and which one is best to use
9 ответов
+ 1
Prakash yes. You can get an error message 'cannot reference [thing] in a static context' and this is the reason. Static members do not belong to an instance so can only refer to the non-instance (static) members
+ 5
oops language? What is that supposed to mean?
+ 5
How about the "s"?
+ 4
Which language?
+ 2
A member function can operate on the state of an object, but a static method cannot. Static method is invoked on the class, with no reference to any particular instance, otherwise a method is invoked on an instance and can interact with that instance
0
basically c#,but is it not the same for all oops language ?
0
object oriented programming
0
it'll be called as oops in short
0
Dan Walker So what you mean by the way is ,you can only access the static member variables inside the static function ?