Ideone's FAQ page doesn't cover that, I think. I am able to write my code in main.c or main.cpp respectively, but would I be able to create a header file, and include it to my main()
?
For example, Overleaf for latex allows me to have multiple files.
You don't strictly need to create a header to reproduce a piece of code that uses a header. You can perform the preprocessing manually, and copy the contents of the header in place of the include.
However, to demonstrate the behaviour of the preprocessor itself, the ability to create a header would be needed. I don't think that is possible on ideone.
https://wandbox.org/ appears to have proper support for multiple files.
On http://coliru.stacked-crooked.com it is technically possible by injecting from the command line. Not practical for long headers, for obvious reasons.
echo 'inline int foo(){return 42;}' > header.h && g++ main.cpp && ./a.out