Sunday, September 25, 2011

Return current time

Return current time
=============
Macro: __TIME__
Return as: String
Example:
    # include<stdio.h>
    int main()
    {
    printf("Current time: %s",__TIME__);
    return 0;
    }

Return line number

Return line number
=============
Macro: __LINE__
Return as: Integer
Example:
    # include<stdio.h>
    int main()
    {
    printf("Current time: %d",__LINE__);
    return 0;
    }

From: Me 

Return file name

Return file name
=============
Macro: __FILE__
Return as: String
Example:
    # include<stdio.h>
    int main()
    {
    printf("Current time: %s",__FILE__);
    return 0;
    }

From: Me 

Return current date

Return current date
=============
Macro: __DATE__
Return as: String
Example:
    # include<stdio.h>
    int main()
    {
    printf("Current time: %s",__DATE__);
    return 0;
    }

From: Me 

Checking ANSI C

Checking ANSI C
============
Macro: __STDC__
Example:
    # include<stdio.h>
    int main()
    {
    printf("Checking ANSI C: %s",__STDC__);
    return 0;
    }

From: Me