Static variable help and explanation

I have this assignment for my C++ class. It asks to use a static variable. I don't have the book with me so I can not look up what that is. Can someone explain what the problem wants me to do as well as an explanation (Or link me to) an explanation of a static variable?
Thank you!

Assignment:
http://gyazo.com/edd0385b20ea84c728ae873cb65276b8
*Update*
Here's my attempt at solving the problem.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
 
int pb(){

	static double unit = 2;
	




}




int main(){
	double x,y;
 	
	
	do {
		
		cout << "Enter a size and price" <<endl;
		cin>>x,y;
		if ( x/y < pb() ) {
			cout<< x/y <<endl;
 		}
		
	} while (x != 0 || y !=0);
	
	
	
	return 0;


}
Last edited on
Your link is broken for me

I assume that you need plain static variable and not member one:
http://www.learncpp.com/cpp-tutorial/43-file-scope-and-the-static-keyword/
Topic archived. No new replies allowed.