Forum Replies Created
karthi
Participant
#define YES 1 —->is syablic parameter.
const int yes=1—> Global declartion
Ex:
Take this example to #define GREEN G
#define statement inform to Complier YES as 1
You have different colours. you have to use colour name in your program many place. Each time you have to type each colour name, Its difficult to do that . So we are using #define statement to solve this probelm. Here we are declaring GREEN as G. So if u type G in your program its equal to GREEN.
So as per your question YES as an 1.
cons int yes=1 is static value we can not change the value.
one week have 7 days this is const. So we can declare weekdays as global variable. so
cons int weekdays=7;
I hope your doubt is clear now..
Thanks in advance.
Viewing 1 post (of 1 total)