5 ms·
why not just do gcc main.c && ./a.out
by glouwbug 6y ago
why not just do
gcc main.c && ./a.out
- smabie 6y agoThat doesn't include the headers. It also leaves a.out on your system.
- sigjuice 6y agoWhat are the headers in this context that are not getting included? Shouldn't main.c include any necessary headers?
- glouwbug 6y agoI mean, take it one step further then: gcc main.c && ./a.out && rm -f a.out
- sigjuice 6y agoWhat is the big deal with just leaving the a.out alone? I might need to run it again, maybe with different arguments. A few a.out files from test programs are not exactly worth fussing over IMHO.
- glouwbug 6y agoTo each their own. If you're in vim, you don't need to leave your editor if you prepend an exclamation mark to the above expression. I often do a lot of prototyping with: !gcc main.c -fsanitize=address -Og && ./a.out