About 56,000 results
Open links in new tab
  1. C++ Functions - W3Schools

    Create a Function. C++ provides some pre-defined functions, such as main(), which is used to execute code. But you can also create your own functions to perform certain actions. To create (often referred to as declare) a function, specify the name of …

  2. C++ Function (With Examples) - Programiz

    In this tutorial, we will learn about the C++ function and function expressions with the help of examples. A function is a block of code that performs a specific task. Learn to code solving problems and writing code with our hands-on C++ course.

  3. Functions in C++ - GeeksforGeeks

    Mar 18, 2025 · A function is a building block of C++ programs that contains a set of statements which are executed when the functions is called. It can take some input data, performs the given task, and return some result.

  4. Functions - C++ Users

    In C++, a function is a group of statements that is given a name, and which can be called from some point of the program. The most common syntax to define a function is: - type is the type of the value returned by the function. - name is the identifier by which the function can be called.

  5. C++ Functions: A Comprehensive Guide for Beginners

    Let's start with the basics of how to create a function in C++. returnType functionName(parameterList) { // Function body // Code to be executed return value; // Optional } Here's what each part means: returnType: The type of data the function will return (like int, float, void, etc.) functionName: A unique name you give to your function

  6. 2.1 — Introduction to functions – Learn C++ - LearnCpp.com

    Sep 28, 2024 · First, let’s start with the most basic syntax to define a user-defined function. For the next few lessons, all user-defined functions will take the following form:

  7. C++ Functions - Online Tutorials Library

    While creating a C++ function, you give a definition of what the function has to do. To use a function, you will have to call or invoke that function. When a program calls a function, program control is transferred to the called function.

  8. C++ Functions with Program Examples - Guru99

    Aug 10, 2024 · This tutorial covers the concepts of C++ functions, syntax, function declaration, built-in and user-defined functions, function calls, passing arguments, and more.

  9. C++ Functions - Tutorial Kart

    Functions allow code reuse, improve readability, and make debugging easier. In C++, a function has the following structure: return_type: Specifies the type of value the function returns. function_name: A unique identifier for the function. parameters_list: (Optional) Input values the function accepts.

  10. Define and Use Functions in C++ | LabEx

    We'll begin by exploring functions with different return types, such as integers, floating-point numbers, characters, and strings. You'll then learn the critical difference between passing parameters by value and by reference, and how default …

Refresh