i need to input a month and check to see if the month exists in the array.
here is the code.
Code:char monthNames[2][10] = {"jan", "feb"}; int check = 0; while(check != 1) { printf("Enter the month: (e.g. January ) "); gets(pdate->month); //printf(pdate->month); //printf(monthNames[0]); // for (int i = 0; i < 2; i++) // { if (pdate->month == monthNames[0]) { printf("correct"); check = 1; break; } // } }
the header im using is <stdio.h> and im getting rather frustrated. please tell me if there is a better way of accomplishing the same thing.. or plz just helpme make this code work.



LinkBack URL
About LinkBacks



