Search
 
SCRIPT & CODE EXAMPLE
 

CPP

c++ get the line which call a function

#include <iostream>
#include <source_location>
 
void foo(const std::source_location &location = std::source_location::current())
{
    std::cout << location.file_name() << ":"
            << location.line() << ":"
            << location.function_name();
}
 
int main()
{
    foo();
    return 0;
}

// main.cpp:13:int main()
Comment

PREVIOUS NEXT
Code Example
Cpp :: c++ filesystem read directory 
Cpp :: check prime cpp gfg 
Cpp :: c++ namespace 
Cpp :: Find minimum maximum element CPP 
Cpp :: remove element from vector c++ 
Cpp :: binary search c++ 
Cpp :: how to find something in a string in c++ 
Cpp :: c ifdef 
Cpp :: compute power of number 
Cpp :: print two dimensional array c++ 
Cpp :: how to get hcf of two number in c++ 
Cpp :: c++ program to convert kelvin to fahrenheit 
Cpp :: input n space separated integers in c++ 
Cpp :: How do I read computer current time in c++ 
Cpp :: binary search in c++ 
Cpp :: how to generate number in c++ 
Cpp :: vector iterating 
Cpp :: how to use a non const function from a const function 
Cpp :: C++ Nested if...else 
Cpp :: how to reverse a vector in c++ 
Cpp :: resize vector c++ 
Cpp :: linux c++ sigint handler 
Cpp :: Exit Button c++ code 
Cpp :: sweetalert2 email and password 
Cpp :: power in c++ 
Cpp :: c++ set intersection 
Cpp :: recursive factorial of a number 
Cpp :: balanced brackets in c++ 
Cpp :: unordered map c++ 
Cpp :: oop in c++ have 5 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =