3 ms·
this is a style i still use today (almost) int main (int argc, char **argv) { //body.. } although most people think i'm weird for it
by foxhill 13y ago
this is a style i still use today (almost)
int
main
(int argc, char **argv)
{
//body..
}
although most people think i'm weird for it..
- lutusp 13y agoYep, that's pretty weird. It harks back to the early days of C. When I first saw the currently recommended form: int main(int argc, char **argv) { //body.. } I thought it was nice but not obviously advantageous, but over the years I've come around to thinking it makes code easier to follow. Even many bash shell scripting guides now recommend a similar form: for x in y; do # body done
- foxhill 13y agoit certainly helps when your function isn't as simple as main..!