I cast int value in vector then for vector.size() condition ,do something my condition is if(values.size()==1) in first time always vector.size() is 1,how can wait to get all int value and doesn't //dosomething of this condition quickly after get first int,need an other condition??
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
vector<int> values;
while(true){
int key = mySwitch.getReceivedValue();
values.push_back(key);
if (values.size() == 1 ) { //not do this in loop quickly wait,maybe vector size is bigger
//do something
}
} elseif (values.size() > 1 && values.size() <= 7) {
//do something else
} elseif (values.size() > 7) {
values.clear();
continue;
}
}
hi tnx but my mean is first vector size first maybe 1 maybe 2 if 1 do first condition if 2 second condition,program doesn't wait for get all int value ,with first value do execute
condition