How to use __LINE__ in a string
- by John
Just using it as a method parameter is fine but what about an easy way to use it in strings?
For instance say I have this:
11 void myTest()
12 {
13 if(!testCondition)
14 logError("testcondition failed");
15 }
And I want the output to be:
"myTest line 14: testcondition failed"
How can I write logError? Does it have to be some monstrosity of a macro?