Recursive functions



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.

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?

.



Relevant Pages

  • Re: main prototype pointless?
    ... It should be: int main; ... I'm not sure there's any reason to do that. ... You may want to do that if you prototype all your functions, ... Ioan - Ciprian Tandau ...
    (comp.lang.c)
  • fsync, unistd.h on gnu/linux/debian
    ... int fsync; ... Including the header is not enough to get the prototype. ... reason why the manual page doesn't say that? ...
    (comp.unix.programmer)
  • Re: A couple of questions re. the function prototype
    ... > I read a good thread on here regarding the reason why we use function ... > prototype if the type the function returned was not an int - I was ... > would assume it was an int. ... That applies to a function *declaration*. ...
    (comp.lang.c)
  • Re: Urgent C Questions
    ... int, not void. ... Then you need to turn up the warning level on QuickC. ... 3  missing prototype for 'main' ... stdio.h contains the declaration for printf: ...
    (comp.lang.c)
  • Re: Wheres the mistake???
    ... Implicit int ... always a good idea to specify the return type of all functions anyhow. ... As I hope you are aware, a prototype is a function ... Dig the even newer still, yet more improved, sig! ...
    (comp.lang.c)