User forums > Using Code::Blocks

which macro is defined for line number in codeblock

(1/1)

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.

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.

--- End quote ---

Thanks very much, This is what i need.

Navigation

[0] Message Index

Go to full version