أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.
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.