Respuesta :

Answer:

Global Variables

Explanation:

A Global variable is a variable defined usually in the header that can be accessed by any part in a program.

However, this is not a good practice because anything in the program can modify the value of the variable; also, helps to get more difficult to read a code, due to the fact that you need to know where are those variables and where they have been modified.

Example en c++: Check that the final result its 10, it is not necessary to pass the variable as a parameter in functions

#include <iostream>

int varGlobal = 5; // this is the global variable

void ChangeVarGlobal()

{

varglobal=10; // reference to the variable

}

void main()

{

std::cout << global << '\n'; // reference to a variable in a second function

  ChangeVarGlobal();

  std::cout << global << '\n';

  return 0;

}