Is there a type of a computer file, like .exe under MS Windows, that enables to directly compile into to run a c++ source code under Linux or MacOS?

Is there a source-code editor that enables to create such a type of a computer file, like the .exe, but under Linux or MacOS, by pressing a button, without using text terminal, like the command line interface?

I am interesting in information about both Linux and MacOS. I am a Windows user. I know nothing about Linux and MacOS.

Thank you.