does anyone do this?
i think it looks much more solidCode:if( 1 ) { x++; }else{ //same line x--; }
does anyone do this?
i think it looks much more solidCode:if( 1 ) { x++; }else{ //same line x--; }
i seem to have GCC 3.3.4
But how do i start it?
I dont have a menu for it or anything.
I have a lot of odd rules, however generally sticking to number 2 (do try and catch don't actually have that high a ratio in my code really). Sometimes I inline small statements following an if too, just if putting it on a newline puts it out of place. Also, 1-2 space indentation is killer, I don't know how some people swear by it. I need like 4-6 spaces per tab at least.Code:int main() { try { while(condition) { if(stuff) { dothings; dothings; } else meh(); } } catch(Exception e) { e.what(); } } void meh() { do { int nRet = thingz(); if(nRet == -1) break; } while(nRet != 0); }
Last edited by Tonto; 08-22-2005 at 01:29 AM.
I accidentally voted 3, but use 2.
>.<
Join is in our Unofficial Cprog IRC channel
Server: irc.phoenixradio.org
Channel: #Tech
Team Cprog Folding@Home: Team #43476
Download it Here
Detailed Stats Here
More Detailed Stats
52 Members so far, are YOU a member?
Current team score: 1223226 (ranked 374 of 45152)
The CBoard team is doing better than 99.16% of the other teams
Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)
Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT
Style #2 (BSD/Allman) is obiously the only correct coding style, since it's the one I use.
I use Allman/BSD, like a lot of the rest of you. It just seems much more clear and easier to read, especially when debugging.
EntropySink. You know you have to click it.
I see K&R used alot in tutorials and such, but I never liked it...
The same can be said about WhitesmithOriginally Posted by Zach L.
Join is in our Unofficial Cprog IRC channel
Server: irc.phoenixradio.org
Channel: #Tech
Team Cprog Folding@Home: Team #43476
Download it Here
Detailed Stats Here
More Detailed Stats
52 Members so far, are YOU a member?
Current team score: 1223226 (ranked 374 of 45152)
The CBoard team is doing better than 99.16% of the other teams
Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)
Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT
is (usually) the same asCode:FILE *fp = fopen("out", "wt");
The latter uses the system default, which is usually 't' (text mode) but can be 'b' (binary mode). You can open a file in binary mode, too.Code:FILE *fp = fopen("out", "w");
So yes, t is a valid mode.Code:FILE *fp = fopen("out", "wb");
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
Umm... are you sure that's in the right thread?
EDIT: Nevermind... I didn't read the whole thread.
EntropySink. You know you have to click it.
I don't know what is most common, but I also normally use style 1.