Basically im trying to make this work (ignore the cheesiness)
#include "stdfx.h"
int main()
{
char *c; //yes
printf("Dad, are you free for lunch tomorrow at 12:30? Please type Y or N\nand then hit enter\n");
scanf_s("%d", &c);
if( c == "y") { printf("Great! let me know where you feel like eating. I only have about 45 min to eat \nbefore I need to work\n"); }
else if ( c == "n" ) { printf("Well you can't blame me for trying...maybe another time\n"); }
return 0;
}
is this the correct way of writing it?
when ever i compile it, it only gives back the "Great" answer. If it isnt clear what im trying to do, I am trying to get it so when he enters "y" it says great, or if he enters any other key it says "well..."
thanks for your help guys!
#include "stdfx.h"
int main()
{
char *c; //yes
printf("Dad, are you free for lunch tomorrow at 12:30? Please type Y or N\nand then hit enter\n");
scanf_s("%d", &c);
if( c == "y") { printf("Great! let me know where you feel like eating. I only have about 45 min to eat \nbefore I need to work\n"); }
else if ( c == "n" ) { printf("Well you can't blame me for trying...maybe another time\n"); }
return 0;
}
is this the correct way of writing it?
when ever i compile it, it only gives back the "Great" answer. If it isnt clear what im trying to do, I am trying to get it so when he enters "y" it says great, or if he enters any other key it says "well..."
thanks for your help guys!