News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

which macro is defined for line number in codeblock

Started by shiki, March 30, 2012, 10:02:55 AM

Previous topic - Next topic

shiki

the line number is used to trace where the something happens. Is there any macro or function like that?
And how to get the current file name when program runs?

oBFusCATed

C/C++ macro or a macro in C::B's marco expansion rules?

(For the C/C++, you've asked at the wrong forum and the topic will be lock)
Here they are: __LINE__, __FUNCTION__, __FILE__

p.s. search the net is the faster option most of the time.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

shiki

its should be OK now. When using GCC , these pre-defined macro are useful : __FILE__,__FUNCTION__,__LINE__
I misunderstood the compiler and the IDE . Under windows, when using vs, there is a little bit moment notice the compiler.

shiki

Quote from: oBFusCATed on March 30, 2012, 11:21:54 AM
C/C++ macro or a macro in C::B's marco expansion rules?

(For the C/C++, you've asked at the wrong forum and the topic will be lock)
Here they are: __LINE__, __FUNCTION__, __FILE__

p.s. search the net is the faster option most of the time.

Thanks very much, This is what i need.