PDA

View Full Version : First use this function


Furiosrexalone
04-18-2007, 08:16 PM
#include <iostream>
using namespace std;
int main()
{
cout<<"This text is located in the file"<<_FILE_<<" on the line"<<_LINE_;
system("pause");
return 0;
}


I thought _FILE_ and _LINE_ are predefined constants. But I get this error: 6 D:\Dev-Cpp\Programe\Test.cpp `_FILE_' undeclared (first use this function) and 6 D:\Dev-Cpp\Programe\Test.cpp `_LINE_' undeclared (first use this function)

Aradon
04-18-2007, 11:01 PM
Isn't it two underscores? That is

__FILE__

__LINE__

(Broken up by a space)

_ _ F I L E _ _

_ _ L I N E _ _