Download as pdf
Download as pdf
You are on page 1of 100
gol 1. Introduction to Object Oriented Programming 41.1 Issues with Procedure Oriented Programming Eas Global variables are visible throughout the program and can be’accessed by all function of Program. So if eny function uses the local variable with the same declaration as globsl variable then value of local variable is used in place of global variable throughout the function, 1 Brogram length is long and by some dilemma value of global variable-is changed then It tc difficult to detect exact location where error takes place. ifincludeciostream> iHinclude using namespace std; inta=2; void add()( coute<"The value of global variable a in add function: " Value of global vartable changes to 3. coute<"The value of global variable a in add function changes to: “<

You might also like