How to Create, Compile, And Run a single file in CLion

前端 未结 6 556
情话喂你
情话喂你 2021-01-31 03:07

I am working on some c++ stuff and I hate having to create a whole new project just to run a few things on a file.

I also don\'t like how when you creat

6条回答
  •  天命终不由人
    2021-01-31 03:45

    For a portable solution across IDE's, I call a scratch() function at the start of my main() and put exit(0); at the end of the scratch function.

    Inside scratch(), you can call something in a different file if you want. I usually just test snippets in there.

提交回复
热议问题