If statement

Pages: 12
i was a little confused as to what pilot wanted originally and adopted his/her term, lol, if i am correct it is a if statement using a logical operator and conditional statements, which in my opinion still makes it a single if statement,,, extended? lol
yea, well I didn't have a name in my head for conditional operator (because I couldn't remember), but people seemed to be calling it extended if.
but possible what he was asking is how to turn 3 if statements into an if/else if/else

As a side note, anybody notice the default size( text width--> ) of this forum?
Last edited on
no worries :) I make this all up as I go along,, ;)
Limiting yourself to 80 characters doesn't make sense unless you expect to read your code on a console or you're going to print it with a dot matrix printer.

I think it's good to keep code below 80 chars per line. If I was reading your code in a terminal[-emulator], I would get kinda angry if it was 100 columns wide and give up.

I set my right margin to 78 chars on gedit to make sure I don't even reach the edge. I think it looks neater anyway. I don't have word wrap on though; just the margin -- if I have to go over 78 chars it's only to end a comment or include a brace or semicolon or something similar.
Last edited on
yep another linux user yay.... I thought I was the only one ;p
shame on you using gedit though! VIM Power FtW


I am curious though why you think 80 is bad Helios? If not 80 then what is a good limit to set? 150? 500? 1500? no restriction ? lets just put the whole program on 1 line and call it quits..
Last edited on
There's a gedit for windows, by the way. I do use Linux though... although I'm on windows (*shudder*) right now on my dad's laptop.

I can use Vim or Pico or Emacs, but I don't see the point. I have a GUI, I may as well use it.

Edit: I also have GVim which is Vim but with an actual GUI and it uses a text entry box as the command line sort of. It's weird.

I think computerquip uses Linux too.
Last edited on
If not 80 then what is a good limit to set?
The sky's the limit.
Okay, sometimes I do break a line if it gets ridiculously long otherwise, and sometimes the breaking column happens to be 81. But considering I can normally display 144 horizontal characters and that wide screen monitors are becoming common, I don't care that much.
People wouldn't be able to see my formatting correctly on a console anyway, what with my indiscriminate use of tabs size 4 and all.

lets just put the whole program on 1 line and call it quits..
Okay!
http://www.fileden.com/files/2008/6/22/1971683/0.cpp
You just did a find-and-replace for '\n' with '' (nothing), didn't you?
"\n"->""
"\t"->""
(two spaces)->(one space)

Of course, I broke all preprocessor directives and single line comments.
Last edited on
:)


Lazy.
ahah
<-making up new terms daily cause helios says his iq drops 2 points every time he reads one,,,hmmmmm how about todays Archie Bunker Term ,, 'functionating extrapolator destructioneer' or 'Varabulous' -a fabulous variable,, just think,, in a month or so,, he'll be down on my level with a playschool sippy cup! :D
Topic archived. No new replies allowed.
Pages: 12