I have forgotten
my Password

Or login with:

  • Facebookhttp://facebook.com/
  • Googlehttps://www.google.com/accounts/o8/id
  • Yahoohttps://me.yahoo.com
get GPL
this unit 1.25
sub units 0.00

month str

Returns a string pointer to the month of the year.
Controller: CodeCogs



Month Str

char*month_strintnMonth )[const]
Returns a string pointer to a description of the month specified, i.e. 1="January", 2=February, 3="March"

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;
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


nMonthis 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;


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.