Hi everybody. I wonder if in C++ or Qt there is some simple way to check if an int equals to some int from a predefined list. I mean something like pseudo code below. Much thanks.
Qt Code:
int a = 3; int b = 8; int c = 20; int x = 5; if (x in [a,b,c]) { //further processing } if (x in [2,7,5]) { //further processing }To copy to clipboard, switch view to plain text mode




Reply With Quote
Bookmarks