0Pricing
C Academy · Lesson

Function Prototypes and Scope

Learn about function declarations, local and global variables, and the scope of variables in C.

1

Function Prototypes and Scope

Function prototypes help declare functions before they are used.

Variable scope determines where a variable can be accessed.

In this lesson, you will learn:

  • How to use function prototypes.
  • The difference between local and global variables.
  • How variable scope affects program behavior.
Function Prototypes and Scope — illustration 1

2

What is a Function Prototype?

A function prototype is a declaration of a function before it is defined.

Syntax:

returnType functionName(parameterType1, parameterType2);

Example:

int add(int, int);

All lessons in this course

  1. Defining and Calling Functions
  2. Function Prototypes and Scope
  3. Recursion in C
← Back to C Academy