Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #73661

Re: C function prototype and body definitions

From sfisher@panix.com (Stephen Fisher)
Newsgroups comp.lang.c
Subject Re: C function prototype and body definitions
Date 2015-10-23 15:58 -0600
Organization PANIX -- Public Access Networks Corp.
Message-ID <n0eaha$ech$1@panix3.panix.com> (permalink)
References <ae13b44e-6dd4-4ff6-b62c-c0c8c58fbe50@googlegroups.com>

Show all headers | View raw


In article <ae13b44e-6dd4-4ff6-b62c-c0c8c58fbe50@googlegroups.com>,
Rick C. Hodgin <rick.c.hodgin@gmail.com> wrote:

>What is the reason for having both a function prototype and a body
>definition, when the body typically replicates the prototype?

A practical reason for me would be so that I remember the variable types and
names while writing the function.  I usually copy the prototype into the
header afterwards.

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

C function prototype and body definitions "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-10-23 10:37 -0700
  Re: C function prototype and body definitions Melzzzzz <mel@zzzzz.com> - 2015-10-23 19:44 +0200
  Re: C function prototype and body definitions Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-10-23 10:53 -0700
    Re: C function prototype and body definitions Keith Thompson <kst-u@mib.org> - 2015-10-23 12:19 -0700
      Re: C function prototype and body definitions "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-10-23 12:27 -0700
        Re: C function prototype and body definitions supercat@casperkitty.com - 2015-10-24 10:46 -0700
          Re: C function prototype and body definitions "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-10-24 12:17 -0700
    Re: C function prototype and body definitions Les Cargill <lcargill99@comcast.com> - 2015-10-23 20:56 -0500
      Re: C function prototype and body definitions gazelle@shell.xmission.com (Kenny McCormack) - 2015-10-24 09:49 +0000
  Re: C function prototype and body definitions Bartc <bc@freeuk.com> - 2015-10-23 19:16 +0100
  Re: C function prototype and body definitions Barry Schwarz <schwarzb@dqel.com> - 2015-10-23 11:30 -0700
  Re: C function prototype and body definitions sfisher@panix.com (Stephen Fisher) - 2015-10-23 15:58 -0600
  Re: C function prototype and body definitions Les Cargill <lcargill99@comcast.com> - 2015-10-23 20:54 -0500

csiph-web