adsense


Friday, 20 November 2015

C++ LANGUAGE LOCAL VARIABLES PAGE 20

COMPUTER LANGUAGES HTML,C,C++.JAVA,.NET AND MULTIMEDIA basics and programs click home button



C++ LANGUAGE LOCAL VARIABLES







Local Variables 


Variables that are declared inside a function or block are 
local variables. They can be used only by statements that 
are inside that function or block of code. Local variables 
are not known to functions outside their own. Following is 
the example using local variables: 

#include <iostream> 

using namespace std; 
  
int main () 
{ 
  // Local variable declaration: 
  int a, b; 
  int c; 
  
  // actual initialization 
  a = 10; 
  b = 20; 
  c = a + b; 
  
  cout << c; 
  
  return 0; 


No comments: