C & C++ Programming
Computer ScienceChapter 4 — Functions and Modular Programming
Lesson 4.3 : Function Declaration and Prototypes
Reading & Interactive Lesson
Function Declaration and Prototypes
Reading Material & Notes
Function Declaration and Prototypes
A function prototype tells the compiler about a function before it is used.
int add(int, int);
int main()
{
printf("%d", add(10, 20));
}
int add(int a, int b)
{
return a + b;
}
Function prototypes improve program organization and help the compiler detect incorrect function calls.
Course Curriculum
10 Chapters • 50 Lessons
Chapter 1 — Introduction to C and C++
5 Lessons
Chapter 2 — Variables, Data Types and Operators
5 Lessons
Chapter 3 — Conditional Statements and Loops
5 Lessons
Chapter 4 — Functions and Modular Programming
5 Lessons
Chapter 5 — Arrays and Strings
5 Lessons
Chapter 6 — Pointers and References
5 Lessons
Chapter 7 — Structures, Unions and Enumerations
5 Lessons
Chapter 8 — Object-Oriented Programming in C++
5 Lessons
Chapter 9 — Inheritance, Polymorphism and Templates
5 Lessons
Chapter 10 — File Handling and Mini Projects
5 Lessons