Predefined macros and line Pre-Processor Directive





This video tutorial explains about some predefined macros such as __LINE__, __FILE__, __DATE__, __TIME__, __STDC__, __cplusplus and the pre-processor directive #line.
You are gonna learn what does predefined macros do and also how to use predefined macros, how to use #line in your program in detail with examples.

source code for this tutorial

#include <iostream>

using namespace std;

int main()
{
cout << "current line is "<<__LINE__<<endl;
cout << "current file is "<<__FILE__<<endl;

cout << "date of translation of source code to object is  "<<__DATE__<<endl;
cout << "compile time  "<<__TIME__<<endl;
cout << "standard c++ code "<<__STDC__<<endl;
cout << "standard c plus plus conforming "<<__cplusplus<<endl;

#line 1000 "anil.txt"
cout << "current line is "<<__LINE__<<endl;
cout << "current file is "<<__FILE__<<endl;
    return 0;
}

Back To Top