Global Variables V/S Static Variables
Thread Tags
Adobe Illustrator Adobe InDesign Adobe Photoshop Android Development Android Programming Android Studio Automation Testing C / C++ Programming Career Options College Lounge css designed Design layout digital marketing Digital Marketing / SEO Fireworks Graphic Design Graphic designing Graphics Design Graphics Designing HTML? Illustrator Internship Training logo Design logo designing mobile phones Photoshop QA react-native Scroll Website SEO Single Page Website Testing Typography UI UI/UX Development UI Design UI Designing UI development User Interface UX Design Viewport Web Designing web pages Website DesignRegister for free!
Registration at Smart Mentors is completely free and takes only a few seconds. By registering you’ll gain:
- Full Posting Privileges.
- Access to Private Messaging.
- Optional Email Notification.
- Ability to Fully Participate.
Register Now, or check out the Site Tour and find out everything Smart Mentors has to offer.
Tagged: C / C++ Programming
This thread contains 1 reply, has 2 voices, and was last updated by Nitesh User Do not delete 2 years, 2 months ago.
- Author Replies
- February 7, 2019 at 10:19 am #53266
What Is The Difference Between Global Variables And Static Variables?
- February 7, 2019 at 10:26 am #53268
The extent of the variable depicts that the variable is accessible at a certain point in the program or not. The contrast between global variables and static variables lies in this idea as it were.
Global variables:
1) Global variables are put away in the Data Segment of the procedure.
2) Global variable’s life is until the life of the program and it very well may be gotten to by different files utilizing extern keyword.
3) The extent of the global variables stays all through the program likewise the life expectancy of these factors is all through the program.
Static variables:
1) A static variable can be proclaimed outside all functions or inside a function utilizing a static keyword before the data type of variable.
2) The extent of the static Variables stays inside the block of code in which they are made yet the life expectancy stays all through the program.
Along these lines, the fundamental distinction is between the scope of both types of variables.
Regards,
Nitesh Bavishiya - AuthorPosts
You must be logged in to reply to this thread.Please login or register. Registration is 100% free.