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;


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



     cout << m;

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



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
#questiowrite a program to calculate e^x

C Program for SORTING # include stdio.h> void main() {           char a;           int *p;           int i,j,temp;           clrscr();           p=&i;

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. #include float start_point,

Pos Console CPP Unit Testing Project Description: Do the CPPUnit Testing for the project. Have all the functions done. Skills required are Android, C Programming, C++ Prog

How would I make a maze in C++? I would prefer to use the recursion maze generation algorithm if possible, thanks!

I need CSGO Wallhack and Human Aimbot Project Description: Need a CSGO hack which can ESP Wallhack and Aimbot realistically. Must be VAC Proof, and ESL proof, as wel

Q: What are User Defined data types? C supports an extraordinary feature known as "type definition" that permits users to define an identifier that would represent an existing

Write a function that computes f(x) for a quadratic polynomial in x, such as the one in assignment 3. Use the function to plot f(x) from -10 to +10.

Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they are send

Greatest Common Divisor (GCD) - The greatest common divisor (GCD) of two integers is the largest integer that will evenly divide both integers. The GCD algorithm involves intege