Will class member functions consume memory storage?

For example:

1
2
3
4
5
6
7
class a {
public:
    int v;//this one will need memory to store

    int method1();//how about these?
    int method2();
    ......


Thanks.
Question is quite undefined.
A function itself will occupy just the space for its activation record from the caller, for parameters and for its local variables on the stack. According to architecture the activation record will contain things like saved registers, address to return when the function is called and whatever.

But a function can allocate how much memory it requires on the heap so there is no a precise answer.

Oh in addition, if the function is recursive then it could use a lot of memory, always because of activation records which are needed between each call.
thanks!
Topic archived. No new replies allowed.