Puedes seguirnos en

BUSCADOR

Engineering

The general form of a function

Functions are the building blocks of C and C++ and the place where all program activity occurs.
The general form of a function is:

SYNTAX


Return-type function-name (Parameter-list)
{
Body of function
}

The return-type specifies the type of that the function returns. A function returns all type of data except array. The parameter list is a list of variables which is separated with a comma. These variables must have their types associated with them. The parameters of a function are optional.
Even though the parameter list is optional, the parentheses are not optional. The variables in the parameter list must be declared individually.

For example, here is correct and incorrect function parameter list declaration:

Anuncio publicitario

EXAMPLE


Int f(int I, int k, float y); //correct
Int f(int I, k, float y);//incorrect

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

Function prototyping is one of the key improvements added to the C++ functions. When a function call is encountered, the compiler checks the function...

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

In assembly language programs, small sequence of codes of the same pattern are repeated frequently at different places which perform the same operation on...

Engineering

The concept at abstraction is commonly found in computer science. A big program is never written as a monolithic piece of program, instead it...