Created
December 20, 2010 22:15
-
-
Save juanarzola/749094 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// defines... | |
#define SECTION_AND_ROW_INT(section, row) (row | section << 16) | |
#define SECTION_AND_ROW_FOR_FIRST_NAME SECTION_AND_ROW_INT(0, 0) | |
#define SECTION_AND_ROW_FOR_LAST_NAME SECTION_AND_ROW_INT(0, 1) | |
#define SECTION_AND_ROW_FOR_AGE SECTION_AND_ROW_INT(1, 0) | |
// ... | |
// sample switch | |
int sectionAndRow = SECTION_AND_ROW_INT(section, row); | |
switch(sectionAndRow){ | |
case SECTION_AND_ROW_FOR_FIRST_NAME:{ | |
//... | |
break; | |
} | |
case SECTION_AND_ROW_FOR_LAST_NAME:{ | |
//... | |
break; | |
} | |
//... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment