Last active
March 8, 2017 08:22
-
-
Save sdrshnptl/cce5932231c65215e1ec3fb44c477900 to your computer and use it in GitHub Desktop.
Predefined Macros in embedded C
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
__DATE__ The current date as a character literal in "MMM DD YYYY" format. | |
__TIME__ The current time as a character literal in "HH:MM:SS" format. | |
__FILE__ This contains the current filename as a string literal. | |
__LINE__ This contains the current line number as a decimal constant. | |
__STDC__ Defined as 1 when the compiler complies with the ANSI standard. | |
*/ | |
#include <stdio.h> | |
main() { | |
printf("File :%s\n", __FILE__ ); | |
printf("Date :%s\n", __DATE__ ); | |
printf("Time :%s\n", __TIME__ ); | |
printf("Line :%d\n", __LINE__ ); | |
printf("ANSI :%d\n", __STDC__ ); | |
} | |
0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment