Home > Back-end >  This is not the language itself a BUG? I was right. The size () understand there is a problem?
This is not the language itself a BUG? I was right. The size () understand there is a problem?

Time:02-07


 
# include
# include
using namespace std;
Int main ()
{
Int k=7;
Vector 9,7,7,9,7,7,9 cardPoints={};
For (int I=cardPoints. The size () - 1; I & gt;=cardPoints. The size () - k; I -)
Cout & lt; }

CardPoints. The size ()=7, k=7, so the cycle of the for loop conditions for i> judgement;=0, but if you are running will find, I don't stop,
I thought is was cardPoints. The size () - k expression not enclosed reason:
 
For (int I=cardPoints. The size () - 1; I & gt;=(cardPoints. The size () - k); I -)

But still, don't stop,
But you just change on the number of k, k=6, k=8, as long as cardPoints. The size () - k is not just equal to zero!!!!!! I haven't any problem,
But once cardPoints. The size () - k is equal to zero, this expression like no judgment conditions,
  • Related