is there a weird rule about symbolic constants?
ok im new so if this question is wayy to easy to answer, forgive me but i have no idea....
the book im learning from says that symbolic constants are exact same values the thing they representing except you can use a different name to represent that value.. but how come this:
Code:
#include <stdio.h>
#define RESPONSE1 1
#define RESPONSE2 2
int main(void)
{
int c;
printf("press 1 for a response, 2 for a different one\n");
while ((c = getchar()) != EOF){
if(c == '1')
printf("hehehhehe.....\n");
if(c == '2')
printf("fool...\n");
}
}
i wrote this while i was bored but found out that "c == '1'" outputs printf but not "c == RESPONSE1"??? shouldnt it be the same thing??