Advertisement
Devian

#define

Jul 29th, 2014
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.31 KB | None | 0 0
  1. #include<stdio.h>
  2. /* important #define doesnt alocate anything on the Memory, const also do that: const int i = 10;  */
  3. #define num 10 // as int
  4. #define ch 'z' // as a char
  5. #define moo 10.2 // as float or double.
  6. int main()
  7. {
  8.     printf("%c\n",ch);
  9.     printf("%d\n",num);
  10.     printf("%2.1f\n",moo); 
  11.    
  12.     return 0;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement