Hi There
Hope someone can help. i am just getting started understanding chars and strings. i can get this code to compile and run but it fails to see when i have entered correct term i.e.
I want you to guess which day of the month im thinking of!
warning: this program uses gets(), which is unsafe.
Please type in your month guess?march
Please type in your month guess?april
Please type in your month guess?feburary
Please type in your month guess?
here is the code, can anyone assist to help me figure out where im going wrong?
Code:
/* Program asking user to guess the correct month */
#include <stdio.h>
#include <string.h>
main()
{
char guessdate[10]; /* Set char for month guesses */
char *feburary = "feburary"; /* Set name of month for correct guess */
printf("I want you to guess which day of the month im thinking of!");
do {
printf("\nPlease type in your month guess?");
gets(guessdate);
} while (guessdate != feburary);
if (guessdate == feburary)
printf("\nCorrect!");
return0;
}
im using x code on a macbook pro