I had a question after reading memTrack library related to http://www.almostinfinite.com/memtrack.html
Can __FILE__ be stored in a variable of type const char* forever and no need to use strdup() ? Doesn't use BlockHeader::Stamp strdup() to assign a __FILE__ string?
void BlockHeader::Stamp(char const *filename, int lineNum, char const *typeName) { myFilename = filename;
Give an example to continue to describe my question:
//testFILE.cpp
after testing, the testFILE binary can print two lines of "testFILE.cpp". That's a coincidence?
c ++ macros
Leo xu
source share