d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Printing Error In Chat Program
Prev12
Add Reply New Topic New Poll
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Sep 23 2013 08:18pm
imo just make the buffer size max + 1, and you can get rid of the loop. if it fills the buffer, obviously it's too large.
Member
Posts: 16,144
Joined: Mar 27 2008
Gold: 14,618.00
Sep 24 2013 12:51pm
Quote (Trev @ 24 Sep 2013 02:31)

Wow my coding sucks, I have no idea where to put the {} and I know that's not even right lol...

seems that you made an indention for the printf. why didn't made this for the stuff after the else? if you make right indention, the brackets are easy ;)
usually:
Code
if (asdf)
asdf;
else
asdf;

but if you use multiple statements for the if or the else, then you want (or need) to make blocks:
Code
if (asdf) {
asdf;
asdf;
} else {
asdf;
}


This post was edited by Richter on Sep 24 2013 12:51pm
Go Back To Programming & Development Topic List
Prev12
Add Reply New Topic New Poll