Thread View: cmu.comp.lang.c++
2 messages
2 total messages
Started by Daniel Teitelbaum
Mon, 02 Oct 1995 05:02
recursive member functions?
Author: Daniel Teitelbaum
Date: Mon, 02 Oct 1995 05:02
Date: Mon, 02 Oct 1995 05:02
18 lines
600 bytes
600 bytes
a quickie:
Can member functions call themselves recursively?
Would this work:
public:
Class Somefunction(Class);
Class Class::Somefunction(Class c)
{
Somefunction(c);
return c;
}
Thanks,
Dan
Re: recursive member functions?
Author: Andrew Koenig
Date: Mon, 02 Oct 1995 13:55
Date: Mon, 02 Oct 1995 13:55
19 lines
736 bytes
736 bytes
In article <okPr9gS00iV586sWJC@andrew.cmu.edu> Daniel Teitelbaum <dt2m+@andrew.cmu.edu> writes:
> Can member functions call themselves recursively?
Sure.
> Would this work:
> Class Class::Somefunction(Class c)
> {
> Somefunction(c);
> return c;
> }
No, but only because there's nothing to stop the recursion.
--
--Andrew Koenig
ark@research.att.com
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads