MACRO which give me the line number of a cpp file?!?
-
Hi world, When I throw an exception I'll want to use a function (or a MACRO) which give me the line number where the throw was detected... for example:
throw SLD_Exception(error_code, "error message", THE_LINE_NUMBER);
...if this line is the 86th, then THE_LINE_NUMBER must return 86... Is this possible??? How to do that??? (I don't use MFC... and don't want to use it...) Thanks in advance! Hello World!!! :) from Raphaël
-
Hi world, When I throw an exception I'll want to use a function (or a MACRO) which give me the line number where the throw was detected... for example:
throw SLD_Exception(error_code, "error message", THE_LINE_NUMBER);
...if this line is the 86th, then THE_LINE_NUMBER must return 86... Is this possible??? How to do that??? (I don't use MFC... and don't want to use it...) Thanks in advance! Hello World!!! :) from Raphaël
Try __LINE__ for the source code line. __FILE__ might also be of interest - this is the source filename. Hope this helps!
-
Try __LINE__ for the source code line. __FILE__ might also be of interest - this is the source filename. Hope this helps!
Thank you... that work fine... Hello World!!! :) from Raphaël