Computer Science, asked by jasmehar, 1 year ago

what is the difference between a static and a non static member function ?


jasmehar: bio ki fair copy me kahan tak ki ho
jasmehar: bio ki fair copy me kahan tak ki ho
jasmehar: batao
jasmehar: yaar
jasmehar: sach ..ham bas unit test syllabus tak
jasmehar: kal aapki bio copy check karenge ham
jasmehar: roz hamko ullu banati ho

Answers

Answered by Harshittiwari2004
2
This differs from language to language, but in C or C++03 functions generally map on assembly functions; that is they exist once in memory (whether free functions, class functions or class static functions) and take arguments as parameters, including a this pointer for member functions that is implicit.

In C++11, lambda functions introduce a novelty: each instance of the so-called function will carry some state. From an implementation point of view, it therefore means that a "regular" function needs be created and it is associated to an anonymous bundle of data (if necessary). The function need not be duplicated each time the lambda is created, but the data does. One helpful figure is to remember that lambdas (in C++) replace function objects (or predicate objects): they are just syntactic sugar, the implementation is similar.
Similar questions