Home
This Week
Top Month
Top Alltime
Search
Register
FAQ
Submit Your Link
Please login to submit your Link
Scope of Variables in Function in C++
Posted:
Oct/08/2009
By:
Guru
Points:
15
Category:
C/C++/VC++
-
C++
Views:
169
Vote Up
(0)
Vote Down
(0)
In this C++ Tutorial you will learn about Scope of Variables in Function viz Local Variables - Scope of Local Variables, Global Variables - Scope of Global Variables.
View Complete Post
Comments:
Be the first to comment this post.
Post Comment
Please login to post your comment
More Related Resources
Variables. Data Types
The usefulness of the "Hello World" programs shown in the previous section is quite questionable. We had to write several lines of code, compile them, and then execute the resulting program just to obtain a simple sentence written on the screen as result. It certainly would have been much faster to type the output sentence by ourselves. However, programming is not limited only to printing simple texts on the screen. In order to go a little further on and to become able to write programs that perform useful tasks that really save us work we need to introduce the concept of variable.
Let us think that I ask you to retain the number 5 in your mental memory, and then I ask you to memorize also the number 2 at the same time. You have just stored two different values in your memory. Now, if I ask you to add 1 to the first number I said, you should be retaining the numbers 6 (that is 5+1) and 2 in your memory. Values that we could now for example subtract and obtain 4 as result.
The whole process that you have just done with your mental memory is a simile of what a computer can do with two variables. The same process can be expressed in C++ with the following instruction set:
C++ Pure Virtual Function and Virtual Base Class
In this C++ tutorial, you will learn about pure virtual function, declaration of pure virtual function and virtual base class, virtual base class and how to implement a virtual base class, explained with examples.
C++ Function Passing Types
In this C++ tutorial, you will learn about function passing types, two types of arguments passing in functions - passed by value and passed by reference are discussed here.
Concept of Function with Arguments in C++
In this C++ Tutorial you will learn about Concept of Function with Arguments - What is an argument Declaring a function, Function Definition and Calling the function.
Concepts of Function in C++
In this C++ Tutorial you will learn about concepts of function - What is a function? Features of Function, Declaring a Function, Defining a function and Calling the function
Categories:
.NET
Java
PHP
C/C++/VC++
HTML/XML
SAP
MainFrames
Data Warehousing
Testing
MySQL
SQL Server
Oracle
Javascript/VB Script
Others
Login
Forgot password
Contact Us
Terms Of use
Share your knowledge