Forum

Global Variables V/S Local Variable

This thread contains 1 reply, has 2 voices, and was last updated by Nitesh User Do not delete 5 years, 10 months ago.

  • Author Replies
    • #53323

      What Is The Difference Between Global Variables And Local Variable?


    • #53325

      Global variables are proclaimed outside any function, and they can be gotten to (utilized) on any function in the program. Local variables are proclaimed inside the function and can be utilized just inside that function. It is conceivable to have local variables with a similar name in various functions.

      Global Variables:

      1) Declaration – Variables are proclaimed outside any function.
      2) Scope – Throughout the program.
      3) Access – Accessed by a statement in the whole program.
      4) Life – Remain in presence for the whole time your program is executing.
      5) Storage – Stored on a settled area chosen by a compiler.

      Local Variable:

      1) Declaration – Variables are pronounced inside a function.
      2) Scope – Within a capacity, inside which they are proclaimed.
      3) Access – Accessed just by the statements, inside a function in which they are proclaimed.
      4) Life – Created when the function block is entered and annihilated upon exit.
      5) Storage – Local variables are put away on the stack except if determined.


      Regards,
      Nitesh Bavishiya

Viewing 1 reply thread

You must be to reply to this thread.Please or . Registration is 100% free.

GET FREE CONSULTATION

Call Us Now For Free Consultation97370 05566

Our experts listen to you patiently and suggest you the right course after conducting a personality profile test. Register your interest below to schedule personality profile test for you.

SUBSCRIBE TO OUR NEWSLETTER

Subscribe to get latest updates regarding courses, IT industry and career prospects.

Copyright 2016-2024 Smart Mentors. All Rights Reserved.

Login

FORGOT PASSWORD

Sign up now to Become An Instructor

    Register your Interest

      cf7captchaRegenerate Captcha