How to get the current executable name in C++

1 Answer

0 votes
#include <iostream>
#include <filesystem>

int main(int argc, char* argv[])
{
    std::cout << std::filesystem::path(argv[0]).filename() << '\n';
}


/*
run:

"3d.exe"

*/

 



answered Jun 3, 2025 by avibootz

Related questions

1 answer 137 views
2 answers 112 views
1 answer 155 views
1 answer 137 views
1 answer 175 views
1 answer 178 views
2 answers 165 views
...