Translating a project to a single file

Hello everybody,

I am writing in C++ and during long contests I feel more comfortable to create a project for the given task. Nevertheless, at the end I am supposed to submit a single file. I am curios if you use some tools that digest the project to a file?


What editor are you using?

In Emacs you could open the same file in different buffers and use narrow-to-region on different parts of the file. That also works well with the Codingame Sync extension, because it’s still just one file. It only looks like you have multiple files open.

Usually Visual Studio or CodeBlocks

Ok, it turned out I can do the same in Visual Studio as well. I didn’t know about that. Looks cool.

I am curios if you use some tools that digest the project to a file?

I thought about looking for such a tool or hacking some bash script, but I decided to use namespaces instead. That works well enough for me at the moment.

When i code in javascript i use requirejs. I code in multiple files and i have a grun + watch script for compile all the file into a single one. I use a the codingame sync firefox greasemokey script to update the file in the IDE.

At the moment when i code in C++ it’s all in one file. I should take the time to create a makefile for that.

I was wondering for the same, but I didn’t know how to do it :\