Skip to content
AddrnoteAddrnote
Main Navigation
Languages
C++Java
Frontend
HTMLCSSJavaScript
Backend
Java WebGo Web
Databases
MySQLRedis
Game Development
UnityGodotCocos
System Design

English

简体中文

English

简体中文

Appearance

Sidebar Navigation

C++ Basics

Variables

Fundamental Types

Integer Types

Signed Integers

Unsigned Integers

Floating-Point Types

Scope and Lifetime

Scope

Storage Duration

Functions

Declarations and Definitions

Parameters and Return Values

C++ Basics Demo

On this page

Functions ​

A function gives a name to reusable logic. Its signature describes the function name and parameter types, while its return type describes the result of a call.

cpp
int add(int left, int right) {
  return left + right;
}

Subtopics ​

  • Declarations and Definitions
  • Parameters and Return Values
Edit this page on GitHub

Last updated:

Pager
Previous pageStorage Duration
Next pageDeclarations and Definitions