How to use the macro __FILE__ to get the location of a the current source file in C

1 Answer

0 votes
#include <stdio.h> 

int main(void)
{
    printf("%s",__FILE__);
       
    return 0;
}
   
           
/*
run:
        
D:/c_programming_test/c_test/test/main.c

*/

 



answered May 25, 2017 by avibootz

Related questions

2 answers 200 views
1 answer 116 views
1 answer 151 views
1 answer 130 views
1 answer 138 views
...