Global Constants |
||||
40 views
We can define constants of any Data type by using the #define compiler directive. Its syntax is simple as under : #define assigning SALARY_MIN and SALARY_MAX by the values 1500 and 15000, respectively. Because C is a case-sensitive language ,it distinguishes between lowercase and uppercase letters in variable names. It is recommended to use capital letters in defining global constants.Now by using this simple code we define max and min salary globally.While using these two variable at any place in our program compiler take their defined value. NOTE : #define should be used at the top-most position of program before every code whether its #include. |
| « Control Strings Using In printf() And scanf() | Loops » |
| Posted on Thursday, June 12th, 2008 at 11:28 am under C For Beginners | RSS 2.0 Feed | |