Puedes seguirnos en

BUSCADOR

Engineering

Function prototyping in C++

Function prototyping is one of the key improvements added to the C++ functions. When a function call is encountered, the compiler checks the function call with its prototype so that correct arguments types are used. The compiler checks the function call with its prototype so that correct argument types are used. The compiler informs the user about any violations in the actual parameters that are to be passed to a function.

A function prototype is a declaration statement which has the following syntax:

type function_name (argument list);

The type specifies the data type of the value in the return statement. The function can return any data-type; if there is no return value, a keyword “void” is placed before the function name. The function declaration terminates with a semicolon.

Anuncio publicitario

Consider the prototype statement:

int max(int x, int y); //prototype

It informs the compiler that the function max has two arguments of the type integer. Function declaration are also called as prototype.

Anuncio publicitario
Escrito por

Administrador de ENGGDRCAOS. Canal dedicado especialmente a la formación del estudiante que aspira a ser ingeniero. Todos los videos son Ingles. Apasionado del universo Apple, estudiante de Ingeniería y Gamer por vocación.

Publicidad

ARTÍCULOS RELACIONADOS

Engineering

If we want two computers to communicate over a network, then the protocols on each layer of OSI model in the sending computer should...

Engineering

Destructors is used to destroy the objects that have been created by a constructor. The destructor is member function whose name is the same...

Engineering

Inheritance is not just simply about creating various derived classes trough a base class. There are some other benefits of using Inheritance in Object...

Engineering

When virtual functions are created for implementing late binding, there are some basic rules that satisfy the compiler requirements: The virtual function must be...