How to get the number of the current line in code with C

1 Answer

0 votes
#include <stdio.h>

void f() {
   printf("Line: %d\n", __LINE__);
}

int main()
{
   f();
   
   return 0;
}  
  
      
/*
run:
       
Line: 4
  
*/

 



answered Jul 3, 2020 by avibootz

Related questions

...