Register now or log in to join your professional community.
Global variables are the variables which are declared outside the main function in c++.
Local variable are the variables which are declared within method().These variables can be accessed within which they are declared
Global variables can be accessed anywhere within the program.
Local variables which are declared with the same name as Global variables hides the Global variables.
Therefore wastage of memory.