/ ************************************************************************
*
* Purpose: Program to demonstrate functions.
* Author: M J Leslie.
* Date: 28-Feb-94
*
************************************************************************/
int add( int, int); /* Function declaration */
main()
{
int i=1;
printf("i starts out life as %d.", i);
i = add(1, 1); /* Function call */
printf(" And becomes %d after function is executed.\n", i);
}
/************************************************************************/
int add( int a, int b) /* Function definition */
{
int c;
c = a + b;
return c;
}
| file: /techref/language/ccpp/cref/EXAMPLES/function.c, 0KB, , updated: 1997/4/21 09:52, local time: 2010/3/20 09:44,
38.107.191.114:LOG IN
|
| ©2010 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? Please DO link to this page! Digg it! <A HREF="http://www.piclist.com/techref/language/ccpp/cref/EXAMPLES/function.c"> language ccpp cref EXAMPLES function</A> |
| Did you find what you needed? |
|
PIC 16 series Microcontroller Instruction Set Reference. And his Hobby Electronics web site at http://hobby_elec.piclist.com. |
.