Empty controlled statement error.

Getting this warning 'empty controlled statement found'
I can normally spot these, but in this case I cannot.
Here is a portion of the code.

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
template < class T >
int movement (vector<T> &genvector) 
{

//other code
 int usePts = 0;
  cout<<"Enter Order.\n";
  cin >> usePts;
				 
	 int ordertot = genvector[chain].orders;  //vector of objects passed into template function

	    if(usePts > ordertot);
			 {
	    		cout<<" Insufficient orders.\n"; 
			 }

		 if(usePts <= ordertot); //this being line 1410 referred to  
			 {
			   genvector[chain].giveorders (-usePts);  
			   moday = (usePts*2); //this is part of other code.
			 }

 return 0;
 }


//error = (1410): warning C4390: ';' : empty controlled statement found; is this the intent? 
Last edited on
The problem is the ; in
 
if(usePts <= ordertot); 


The ; reprisent the {} of the if-statement and the {} below that are ignored becouse they
are not preceded by a command

And by that I mean the {} are ignored and the commands within are always executed.

The same is true for line 12 (1405 in your program).
Last edited on
Thanks Thenero.
I cannot believe i couldnt spot such a basic error. I am a moron.
Thanks again.
Topic archived. No new replies allowed.