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 225 views
2 answers 231 views
1 answer 258 views
1 answer 239 views
1 answer 270 views
1 answer 267 views
2 answers 296 views
...