Key Concepts

Review core concepts you need to learn to master this subject

Introduction to Functions

#include <iostream> void printTitle() { std::string msg = "Codecademy\n"; std::cout << msg; } int main(){ printTitle(); return 0; }

A function in C++ contains a set of instructions that are executed when it is called.

A function declaration is composed of three parts:

  1. Function return type
  2. Function name
  3. Function parameters

A function can be called by specifying its name followed by a pair of parentheses ().

What you'll create

Portfolio projects that showcase your new skills

Pro Logo