PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Simple-Libraries
Learn
Examples
C Intro
Functions
Function with Parameters and Return Value.c
1
/*
2
Function with Parameters and Return Value.c
3
4
Pass parameters to a function, let it do its job, and display the result
5
it returns.
6
7
http://learn.parallax.com/propeller-c-functions/function-parameters-and-return
8
*/
9
10
#include "
simpletools.h
"
// Include simpletools
11
12
int
adder(
int
a,
int
b);
// Function prototype
13
14
int
main
()
// main function
15
{
16
int
n = adder(25, 17);
// Call adder function
17
print
(
"adder's result is = %d"
, n);
// Display adder function result
18
}
19
20
int
adder(
int
a,
int
b)
// adder function
21
{
22
int
c = a + b;
// Add two values
23
return
c;
// Return the result
24
}
simpletools.h
This library provides convenient functions for a variety of microcontroller I/O, timing,...
print
int print(const char *format,...) __attribute__((format(printf
Print format "..." args to the default simple terminal device. The output is limited to 256 bytes.
main
int main(void)
Definition:
GraphicsTest.c:20
Generated on Fri May 20 2022 16:48:04 for PropWare by
1.8.17