Define global variable in c++ program, C/C++ Programming

Define global variable in c++ program:

How to define a global variable and need of global variable in c++ program.

int main()

{

   int m=20;

   clrscr();

   for( int i=0;i<4;i++)

   {

     m=60;

     cout << m;

     cout<<"the global variable is\n"<

   }

     getch();

return m;

}

Posted Date: 10/19/2012 2:58:16 AM | Location : United States







Related Discussions:- Define global variable in c++ program, Assignment Help, Ask Question on Define global variable in c++ program, Get Answer, Expert's Help, Define global variable in c++ program Discussions

Write discussion on Define global variable in c++ program
Your posts are moderated
Related Questions
A: No. If they're utilized properly, they increase encapsulation. You frequently require splitting a class in half while the two halves will have distinct numbers of instances o


HOW CAN WE EASLY LEARN C++


a program to find the area under curve y=f(x) between x=a and x=b,integrate y=f(x) between the limits of a and b.   #include float start_point, /* G

How to write a function template A function template should be written at the beginning of the program in the global area, or you may place it into a header file. All function

Define the Meaning of Call by reference? In "call-by- reference", as an alternative of passing the value of a variable, the location number (or the address) of the variable is

Scope Resolution operator: The scope resolution operator: : is used to access global variable in the inner block. When global and local variable are identical name the scope re

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

To complete this assignment, edit the following constructors and methods: 1. public MaxPQ(Key[] keys) - change the following loop for (int k = N/2; k >= 1; k--) sink(k);