PropWare
C++ objects and CMake build system for Parallax Propeller
Home
Download
Getting Started
Documentation
Reference
About
Related Links
Namespace List
Class List
File List
Examples
Build System
File List
File Members
propsideworkspace
Learn
Examples
C Intro
Functions
Global Exchange.c
1
/*
2
Global Exchange.c
3
4
Functions exchange information with global variables.
5
6
http://learn.parallax.com/propeller-c-functions/memory-functions-can-share
7
*/
8
9
#include "simpletools.h"
// Include simpletools
10
11
void
adder(
void
);
// Forward declaration
12
13
int
a, b, n;
// Global variables
14
15
int
main
()
// main function
16
{
17
a = 96;
// Set values of a & b
18
b = 32;
19
adder();
// Call adder function
20
print(
"n = %d\n"
, n);
// Display result
21
}
22
23
void
adder(
void
)
// Adder, no parameters or return
24
{
25
n = a + b;
// Use values of a & b to set n
26
}
main
int main(void)
Definition:
GraphicsTest.c:20
Generated on Sat Aug 27 2016 00:58:03 for PropWare by
1.8.12