[ Log In ]
Custom stencil for PCB (Printed Circuit Board)
3 Foot USB Cable Type A to USB Cable Type A

USB Cable Type A Male to USB Type A Male - 3 FT

$2.65
Qty:
USB 2.0 Cable 10 Foot Type A Male to Type B Male

USB 2.0 Cable Type A Male to Type B Male - 10 FT

$4.80
Qty:
Type K Thermocouple Temperature Sensor

Type K Thermocouple - Temperature Sensor

$4.95
Qty:
Multimeter Security Banana Plug To Test Hook Clip Probe Lead Cable 500V

Multimeter Security Banana Plug To Test Hook Clip Probe Lead Cable 500V

$8.99
Qty:
Tumbnail: 62 oz-in NEMA 17 Stepping motors (also called stepper motor)

NEMA 17 Stepping Motor (62 oz-in 5mm single shaft)

$19.95 Out of Stock
Qty:
Image of the Atmega324p

Atmega324P

$8.50
Qty:

10K timmer potentiometer

10K Trimmer Potentiometer (Through Hole)

$0.85
Qty:
16x2 LCD (Liquid Crystal Display)

16x2 LCD (Liquid Crystal Display)

$12.50
Qty:

Programming: Creating Prototypes for Functions and Skeleton Functions

Why are prototypes needed. Prototypes are used for the compiler to know in advance the functions that will be used before the functions are defined. It allows the programmer to place the actual functions in any order in the program. For example, if a function1 used function2 within its code and function2 was defined after function1, then the compiler would get confused.
Example (using no prototype):

void Function1()
{ newValue = Function2() }

int Function2()
{ return 1; }

When the compiler tries to compile Function1 and gets to the use of Function2, it knows nothing about Function2, so the compiler would not be able to continue.

Example (with prototype):

int Function2(void);

void Function1()
{ newValue = Function2() }

int Function2()
{ return 1; }

Now the compiler is not confused because it knows the return type and that it will not have any parameters passed in. This makes allows the compiler to continue.

Comments and Additional Information

Have some code to share? Or additional information? Respond here:

You need to be logged in to save a response on this page. The response must be constructive, helpful, supplimentary or to correct the existing video, code or narrative content.

Description:

Code (optional):