answersLogoWhite

0


Best Answer

There are five types of functions and they are:

  1. Functions with no arguments and no return values.
  2. Functions with arguments and no return values.
  3. Functions with arguments and return values.
  4. Functions that return multiple values.
  5. Functions with no arguments and return values.

Functions with no arguments and no return value.

A C function without any arguments means you cannot pass data (values like int, char etc) to the called function. Similarly, function with no return type does not pass back data to the calling function. It is one of the simplest types of function in C. This type of function which does not return any value cannot be used in an expression it can be used only as independent statement.

Functions with arguments and no return value.A C function with arguments can perform much better than previous function type. This type of function can accept data from calling function. In other words, you send data to the called function from calling function but you cannot send result data back to the calling function. Rather, it displays the result on the terminal. But we can control the output of function by providing various values as arguments. Functions with arguments and return value.This type of function can send arguments (data) from the calling function to the called function and wait for the result to be returned back from the called function back to the calling function. And this type of function is mostly used in programming world because it can do two way communications; it can accept data as arguments as well as can send back data as return value. The data returned by the function can be used later in our program for further calculations. Functions with no arguments but returns value.We may need a function which does not take any argument but only returns values to the calling function then this type of function is useful. The best example of this type of function is "getchar()" library function which is declared in the header file "stdio.h". We can declare a similar library function of own. Functions that return multiple values.So far, we have learned and seen that in a function, return statement was able to return only single value. That is because; a return statement can return only one value. But if we want to send back more than one value then how we could do this?

We have used arguments to send values to the called function, in the same way we can also use arguments to send back information to the calling function. The arguments that are used to send back data are called Output Parameters.

It is a bit difficult for novice because this type of function uses pointer

User Avatar

Wiki User

13y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

11y ago

two types of function calls are there in C Programming

with argument and without argument

with argument -->

[function name] ([argument]);

without argument -->

[function name] ();

Thanks,

Happy Garcha

UFV Canada

This answer is:
User Avatar

User Avatar

Wiki User

7y ago

Functions can be categorised in many different ways:

  • Those that return a value and those that do not.
  • Those that throw exceptions and those that do not.
  • Those that change state and those that do not change state.
  • Those that accept arguments and those that do not.
  • Arguments passed by value or by reference.
  • Global, static and local functions.
  • Class member functions (static/non-static, private/protected/public).
  • Friend functions.
  • Virtual functions, overrides and final functions.
  • Function overloads.
  • Function templates.
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What are the different types of function in c plus plus programming?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What are the two major types of programming languages in c plus plus?

Object oriented programming and structured programming.


How do you convert numeric value into alpha value in c plus plus programming language?

use the _itoa function


What is the difference between constructor and friend function in c plus plus?

A constructor is a method that fires when the object is instantiated. A friend function is a function that has special access to the object. They are two different types of things, and cannot be further differenced.


How is c plus plus built?

C++ object oriented programming (OOP) language and supports three kinds of object types 1) Fundamental Types. 2) Derived Types. 3) Class Types.


When do we use int in c plus plus programming?

'int' is one of the built-in data-types, it is meant to hold integer values.

Related questions

What are the two major types of programming languages in c plus plus?

Object oriented programming and structured programming.


How do you correct the C plus plus programming error missing function header?

You need to #include the header file that contains the missing function's declaration.


How do you convert numeric value into alpha value in c plus plus programming language?

use the _itoa function


What is the difference between constructor and friend function in c plus plus?

A constructor is a method that fires when the object is instantiated. A friend function is a function that has special access to the object. They are two different types of things, and cannot be further differenced.


What is swap in c plus plus programming language?

It is not a reserved word, so can be an identifier (name of a type/variable/function).


What is the unit of programming in c plus plus A. Function B. class C. object D. Attribute?

B. Class.


Is Z equals 1A plus 2BC plus 3D a linear programming objective function?

No. 1a and 3d are linear, but 2bc is not. ■


How is c plus plus built?

C++ object oriented programming (OOP) language and supports three kinds of object types 1) Fundamental Types. 2) Derived Types. 3) Class Types.


When do we use int in c plus plus programming?

'int' is one of the built-in data-types, it is meant to hold integer values.


Is a function call a form of branching in C plus plus?

No. A branch is akin to a goto statement in procedural programming. The code branches off to a new code segment, never to return. A function call is akin to a subroutine in structured programming. When the subroutine is finished, control is returned to the instruction immediately following the function call, just as if the function's code were inline expanded at the call site.


When was Plus - programming language - created?

Plus - programming language - was created in 1976.


What is object oriented in c plus plus?

Object-oriented programming is a feature in C++ that allows you to better model real-world objects. An object is an instance of a class, which is a data structure in C++ that allows you to group different, but related types of data together.