Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

What are global variables? How are they declared? What are the problems with using globals?

user-image
Question ajoutée par Rizwan Shah , Project Manager , COMSATS IIT
Date de publication: 2014/09/30

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.

More Questions Like This