Index mapping: Difference between revisions

Content deleted Content added
Line 26:
Example of another C function – incrementing a month number (x) by 1 and automatically resetting if greater than 12
<source lang="c">
static const int M[12] ={2,3,4,5,6,7,8,9,10,11,12,1}; /* 10-based table to increment x */
return M[x - 1]; /* return with new month number */
</source>