Macro Function _FILE_, _LINE_, _DATE_,_TIME for code::blocks

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
nick21
Posts: 23
Joined: Thu 24 May 2018, 04:46

Macro Function _FILE_, _LINE_, _DATE_,_TIME for code::blocks

#1 Post by nick21 »

Hello,

I learn C/C++ after a book and in code::blocks 13.12 I must test macro function _FILE_, _LINE_, _DATE_, _TIME_ but unfortunately these function don't appear in code::blocks, it show me something like :"error _FILE_ is undeclared"


#include <stdio.h>

void main(void)
{
printf("%s",_FILE_);
}


Can somebody help me?

I use C in code::blocks 13.12 and devx-83-xerus64

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#2 Post by SFR »

These macros should have 2 underscores on each side, e.g. __FILE__ not _FILE_.

Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

Post Reply