• Skip to main content
  • Skip to primary sidebar
  • Skip to secondary sidebar
  • Skip to footer

Computer Notes

Library
    • Computer Fundamental
    • Computer Memory
    • DBMS Tutorial
    • Operating System
    • Computer Networking
    • C Programming
    • C++ Programming
    • Java Programming
    • C# Programming
    • SQL Tutorial
    • Management Tutorial
    • Computer Graphics
    • Compiler Design
    • Style Sheet
    • JavaScript Tutorial
    • Html Tutorial
    • Wordpress Tutorial
    • Python Tutorial
    • PHP Tutorial
    • JSP Tutorial
    • AngularJS Tutorial
    • Data Structures
    • E Commerce Tutorial
    • Visual Basic
    • Structs2 Tutorial
    • Digital Electronics
    • Internet Terms
    • Servlet Tutorial
    • Software Engineering
    • Interviews Questions
    • Basic Terms
    • Troubleshooting
Menu

Header Right

Home » C++ » C++ Functions

Data Storage Type in C++

By Dinesh Thakur

Auto

The values of the variables are not retained beyond the scope of a function in which they are declared. The values of the variables can be accessed only during the execution of a function. Whatever variables are declared in a function, they are assumed implicitly of auto storage type. For example in the following program segment. [Read more…] about Data Storage Type in C++

Write C++ program is used for finding the real root of an equation by Newton Raphson technique

By Dinesh Thakur

[Read more…] about Write C++ program is used for finding the real root of an equation by Newton Raphson technique

Write C++ Program Illustrates Passing Structure To A Function.

By Dinesh Thakur

[Read more…] about Write C++ Program Illustrates Passing Structure To A Function.

Array as Argument in A Function in C++

By Dinesh Thakur

Arguments in a function can also be of array type. When the arrays are passed by value in a function, it is written as shown in the following example: [Read more…] about Array as Argument in A Function in C++

Recursive Function

By Dinesh Thakur

A recursive function is a function which invokes itself repeatedly. In this case function name appears within the function. Two examples of recursive function are given as follows: [Read more…] about Recursive Function

Functions With or Without Return Value

By Dinesh Thakur

A function can also return values to the calling program. For such functions, the type of the value returned to the calling function should be mentioned before the function name in the definition. The general syntax of a function which returns value is: [Read more…] about Functions With or Without Return Value

Function Overloading

By Dinesh Thakur

In some cases when a similar action is to be performed on different types of data, different functions having different names are to be defined for all types of data. This makes the program very complex as the programmer must keep a track of the names of all the functions defined in the program. To prevent such situations, C++ allows the functions to be overloaded. [Read more…] about Function Overloading

A program to demonstrate the concept of returning a reference

By Dinesh Thakur

[Read more…] about A program to demonstrate the concept of returning a reference

A program to demonstrate the concept of functions returning values

By Dinesh Thakur

[Read more…] about A program to demonstrate the concept of functions returning values

Static Variables Within Functions in C ++

By Dinesh Thakur

Any value assigned to an automatic variable within a function is lost once the control returns from the called function to the calling function. However, there may be a situation where the value of the local variable needs to be preserved even after the execution of the function gets over. This need can be fulfilled by declaring the variable as static. A static variable is commonly used when it is necessary for a function to remember a value between its calls. To understand the concept of static variables, consider this example. [Read more…] about Static Variables Within Functions in C ++

Arguments to main () in C ++

By Dinesh Thakur

Like C, C++ enables to pass arguments to the main () function also. These arguments are passed by typing them after the program name on the command line. Hence, these arguments are known as command line arguments. Command line arguments help in providing data to the program. [Read more…] about Arguments to main () in C ++

C++ function Call by Reference

By Dinesh Thakur

In addition to call by value, a function can also be called by reference. C++ provides two ways of passing arguments as reference to a function. The arguments can be passed either as a reference type or as a pointer type. [Read more…] about C++ function Call by Reference

C++ function call by value

By Dinesh Thakur

When a function is called by value, the values of the actual arguments are copied into the formal arguments and the function works with these copied values. As a result, any changes made to the copied value in the called function do not affect the value of the actual argument in the calling function. [Read more…] about C++ function call by value

Invoking Functions in C++

By Dinesh Thakur

In order to use a function in different parts of a program, the function must be called or invoked by another function. In C++, functions are called by specifying the name of the function, followed by the parentheses. The parentheses mayor may not contain a list of arguments depending on the function definition. [Read more…] about Invoking Functions in C++

Definition of Function in C++

By Dinesh Thakur

In order to use a function in a program, the function must be first defined somewhere in a program. A function definition contains the code that specifies the actions to be performed. The syntax for defining a function is [Read more…] about Definition of Function in C++

What is Function Declarations or Function Prototype?

By Dinesh Thakur

Like variables, functions also need to be declared before they are used in programs. A function declaration is also known as function prototype. Function prototype is a model or a blueprint for a function that informs the C++ compiler about the return type, the function name, and the number and data type of the arguments passed to the function. Function name together with parameter list is known as function signature and it does not include return type of a function. The syntax for declaring a function is [Read more…] about What is Function Declarations or Function Prototype?

Write A C++ Program To Illustrate The Concept Of Passing Of One Dimensional Array To Function.

By Dinesh Thakur

[Read more…] about Write A C++ Program To Illustrate The Concept Of Passing Of One Dimensional Array To Function.

Write A C++ Program To A Simple Program That Demonstrates Void ().

By Dinesh Thakur

[Read more…] about Write A C++ Program To A Simple Program That Demonstrates Void ().

Write A C++ Program To Explain The Concept Of Function Prototyping.

By Dinesh Thakur

[Read more…] about Write A C++ Program To Explain The Concept Of Function Prototyping.

Write A C++ Program To Display Fibonacci Using Recursion.

By Dinesh Thakur

[Read more…] about Write A C++ Program To Display Fibonacci Using Recursion.

Write A C++ Program To Find HCF Using Recursion.

By Dinesh Thakur

[Read more…] about Write A C++ Program To Find HCF Using Recursion.

Write A C++ Program To Find The Sum Of All Even Numbers From 0 To 20 Using Function Recursion.

By Dinesh Thakur

[Read more…] about Write A C++ Program To Find The Sum Of All Even Numbers From 0 To 20 Using Function Recursion.

Write A C++ Program To Find The Factorial Of A Number By Using The Recursion.

By Dinesh Thakur

[Read more…] about Write A C++ Program To Find The Factorial Of A Number By Using The Recursion.

Write A C++ Program To Add, Subtract And Multiply Two Numbers By Using The Function Within Function Concept (Nesting Of Function).

By Dinesh Thakur

[Read more…] about Write A C++ Program To Add, Subtract And Multiply Two Numbers By Using The Function Within Function Concept (Nesting Of Function).

Write A C++ Program To Find The Maximum Number Among Five Different Integers Using Nested Function Call.

By Dinesh Thakur

[Read more…] about Write A C++ Program To Find The Maximum Number Among Five Different Integers Using Nested Function Call.

Write A C++ Program That The Function That Return Multiple Values.

By Dinesh Thakur

[Read more…] about Write A C++ Program That The Function That Return Multiple Values.

Write A C++ Program That The Function With No Arguments But Return Value.

By Dinesh Thakur

[Read more…] about Write A C++ Program That The Function With No Arguments But Return Value.

Write A C++ Program That the Function with Arguments and Return Value

By Dinesh Thakur

[Read more…] about Write A C++ Program That the Function with Arguments and Return Value

Write A C++ Program That The Function With Arguments And No Return Value.

By Dinesh Thakur

[Read more…] about Write A C++ Program That The Function With Arguments And No Return Value.

Write A C++ Program That The Function With No Arguments And No Return Value.

By Dinesh Thakur

[Read more…] about Write A C++ Program That The Function With No Arguments And No Return Value.

Next Page »

Primary Sidebar

C++ Tutorials

C++ Tutorials

  • C++ - Data Types
  • C++ - Operators Types
  • C++ - CPP Program Structure
  • C++ - Conditional Statements
  • C++ - Loop
  • C++ - do-While Loop
  • C++ - Control Statements
  • C++ - Tokens
  • C++ - Jump Statements
  • C++ - Expressions
  • C++ - Constants
  • C++ - Character Set
  • C++ - Iteration Statements
  • C++ - I/O Statements
  • C++ - String
  • C++ - Manipulators

C++ Operator

  • C++ - Input/Output Operator
  • C++ - Operator Overloading

C++ Functions

  • C++ - Functions
  • C++ - Member Functions
  • C++ - Returning Object from Function
  • C++ - Call by Value Vs Reference
  • C++ - Friend Function
  • C++ - Virtual Function
  • C++ - Inline Function
  • C++ - Static Data Members
  • C++ - Static Member Functions

C++ Array & Pointer

  • C++ - Array
  • C++ - Array of Objects
  • C++ - Arrays as Class Members
  • C++ - Vector
  • C++ - Pointer
  • C++ - 'this' Pointer

C++ Classes & Objects

  • C++ - Class
  • C++ - Program Structure With Classes
  • C++ - OOP’s
  • C++ - Objects as Function Arguments
  • C++ - Procedure Vs OOL
  • C++ - Object Vs Class
  • C++ - Creating Objects
  • C++ - Constructors
  • C++ - Copy Constructor
  • C++ - Constructor Overloading
  • C++ - Destructor
  • C++ - Polymorphism
  • C++ - Virtual Base Class
  • C++ - Encapsulation

C++ Inheritance

  • C++ - Inheritance
  • C++ - Multiple Inheritance
  • C++ - Hybrid Inheritance
  • C++ - Abstraction
  • C++ - Overloading

C++ Exception Handling

  • C++ - Exception Handling
  • C++ - Templates
  • C++ - Standard Template Library

C++ Data Structure

  • C++ - Link List

C++ Programs

  • C++ Program for Electricity Bill
  • C++ Program for Multiply Matrices
  • C++ Program for Arithmetic Operators
  • C++ Program For Matrices
  • C++ Program for Constructor
  • C++ Program Verify Number
  • C++ Program Array Of Structure
  • C++ Program to find Average Marks
  • C++ Program Add And Subtract Matrices
  • C++ Program Menu Driven
  • C++ Program To Simple Interest
  • C++ Program To Find Average
  • C++ program exit()
  • C++ Program Using Array Of Objects
  • C++ Program Private Member Function
  • C++ Program To Reverse A String
  • C++ Program to Operator Overloading

Other Links

  • C++ - PDF Version

Footer

Basic Course

  • Computer Fundamental
  • Computer Networking
  • Operating System
  • Database System
  • Computer Graphics
  • Management System
  • Software Engineering
  • Digital Electronics
  • Electronic Commerce
  • Compiler Design
  • Troubleshooting

Programming

  • Java Programming
  • Structured Query (SQL)
  • C Programming
  • C++ Programming
  • Visual Basic
  • Data Structures
  • Struts 2
  • Java Servlet
  • C# Programming
  • Basic Terms
  • Interviews

World Wide Web

  • Internet
  • Java Script
  • HTML Language
  • Cascading Style Sheet
  • Java Server Pages
  • Wordpress
  • PHP
  • Python Tutorial
  • AngularJS
  • Troubleshooting

 About Us |  Contact Us |  FAQ

Dinesh Thakur is a Technology Columinist and founder of Computer Notes.

Copyright © 2025. All Rights Reserved.

APPLY FOR ONLINE JOB IN BIGGEST CRYPTO COMPANIES
APPLY NOW