Re: Recursive functions
- From: Martin Ambuhl <mambuhl@xxxxxxxxxxxxx>
- Date: Sun, 01 Apr 2007 01:54:46 -0400
Harry wrote:
Hi all,
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.
#include <string.h>
int reclen(char *s) { return strlen(s); }
no recursive functions are needed.
2)sizeof(int) is 2 bytes in turboC.It is 4 bytes in case of gcc.why
different compilers allocate different amount of memory?what is the
reason behind it?
Because different architectures and different compiler strategies lead to different sizes and forms of pointers.
.
- References:
- Recursive functions
- From: Harry
- Recursive functions
- Prev by Date: Re: VonNeumann/Harvard architecture (was: Places=lvalues and <ot>Pop11</ot>)
- Next by Date: K&R2 Ex1-14
- Previous by thread: Recursive functions
- Next by thread: Re: Recursive functions
- Index(es):
Relevant Pages
|