Re: Recursive functions
- From: "Harald van Dijk" <truedfx@xxxxxxxxx>
- Date: 1 Apr 2007 04:46:38 -0700
Bill Pursell wrote:
On Apr 1, 6:37 am, "Harry" <geharipras...@xxxxxxxxx> wrote:
1)I need your help to solve a problem.
I have a function whose prototype is
int reclen(char *)
This function has to find the length of the string passed to it.But
the conditions are that no local variable or global variable should be
used.I have to use recursive functions.
Ask your instructor what the function should do if its
argument is not a string. Then ask your instructor
why you have been given an idiotic assignment which
will not help you learn to program well. Recursive
functions have a place, and this is not it. It is
unethical and/or incomptetent of your instructor to
teach you how to mis-apply a useful technique.
Why should this not be written as a recursive function? If you ignore
practical concerns which do not necessarily apply during the learning
process, do you have any reasons at all?
.
- Follow-Ups:
- Re: Recursive functions
- From: CBFalconer
- Re: Recursive functions
- From: Bill Pursell
- Re: Recursive functions
- References:
- Recursive functions
- From: Harry
- Re: Recursive functions
- From: Bill Pursell
- Recursive functions
- Prev by Date: Re: Dynamic lists of strings in C
- Next by Date: Re: An interesting C problem
- Previous by thread: Re: Recursive functions
- Next by thread: Re: Recursive functions
- Index(es):
Relevant Pages
|