Why main() in C++ cannot be inlined? February 25, 2023 by Tarik In C++ it is not legal to call the main function in your code, so there’d be no way it could ever be inlined.