month str
Returns a string pointer to the month of the year.
Controller: CodeCogs
Contents
Interface
C++
Excel
Month Str
char*month_str( | int | nMonth | )[const] |
Example 1
- The months of the year are therefore:
#include <stdio.h> #include <codecogs/units/date/month_str.h> #include <codecogs/units/date/constants.h> using namespace Units::Date; int main() { for(int i=January;i<=December;i++) printf("\n Month number [%d] is %s ", i, month_str(i)); return 0; }
Output:Month number [1] is January Month number [2] is February Month number [3] is March Month number [4] is April Month number [5] is May Month number [6] is June Month number [7] is July Month number [8] is August Month number [9] is September Month number [10] is October Month number [11] is November Month number [12] is December
Parameters
nMonth is the numeric value of the month in the range 1 to 12 (inclusive). Values outside this range are wrapped back into range. So nMonth=13 is the same as nMonth=1;
Authors
- Will Bateman (Sep 2004)
Source Code
Source code is available when you agree to a GP Licence or buy a Commercial Licence.
Not a member, then Register with CodeCogs. Already a Member, then Login.