7 Replies - 18923 Views - Last Post: 18 March 2006 - 11:17 AM Rate Topic: -----

#1 warbullet  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 12-March 06

If/Else Conditional Statement in C++

Posted 12 March 2006 - 05:19 AM

I never programmed before (exept python)but can anyone tell me how to put an if/else line in c++

and also what compiler software do you guys use plz

This post has been edited by skyhawk133: 15 March 2006 - 11:53 AM

Is This A Good Question/Topic? 0
  • +

Replies To: If/Else Conditional Statement in C++

#2 dec1pher  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 1
  • View blog
  • Posts: 116
  • Joined: 27-January 06

Re: If/Else Conditional Statement in C++

Posted 12 March 2006 - 08:11 AM

i personally use Vc++ for fun works and GCC for commercial ones. and here is the if else code

if(condition)
{
    // do work
}
else
{
    // do work
}

/* but there are many other forms of an if/else loop like this one */

if(condition)
{
    // do work
}
else if(condition)
{
    // do work
}

/* or this one */

if(condition)
    // do work but only one line!!
else
    // do work same thing

/* or this one */

if(condition)
   // do work but one line
else
{
    // do work
}

/* and it continues like that :) */



hope that helps :)
Was This Post Helpful? 0
  • +
  • -

#3 warbullet  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 12-March 06

Re: If/Else Conditional Statement in C++

Posted 15 March 2006 - 09:47 AM

ty VERY MUTCH!!!
Was This Post Helpful? 0
  • +
  • -

#4 Mrafcho001  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 41
  • View blog
  • Posts: 769
  • Joined: 01-November 05

Re: If/Else Conditional Statement in C++

Posted 15 March 2006 - 02:26 PM

I'd have to say for Windows the best compiler is VC++.

I've been with VS since i started programming. The IDE is very comforable and the compiler is very good as well.

If you have the money definitly go with it. You can also download a free express version, i dont know what thats like but i've heard its really good.
Was This Post Helpful? 0
  • +
  • -

#5 topcat  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 28-February 06

Re: If/Else Conditional Statement in C++

Posted 15 March 2006 - 02:38 PM

Excellent example dec!pher! I also use the VC++ compiler, it is a great IDE.
Was This Post Helpful? 0
  • +
  • -

#6 poke_blade  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 21
  • Joined: 26-February 06

Re: If/Else Conditional Statement in C++

Posted 17 March 2006 - 07:30 AM

Yes,You guessed right.Vc++ is the best compiler(it is great)
Was This Post Helpful? 0
  • +
  • -

#7 born2c0de  Icon User is offline

  • printf("I'm a %XR",195936478);
  • member icon

Reputation: 180
  • View blog
  • Posts: 4,667
  • Joined: 26-November 04

Re: If/Else Conditional Statement in C++

Posted 18 March 2006 - 10:54 AM

I use VC++ and Borland C++
Borland is good too...if you disassemble your code, you'll see that on certain occassions Borland generates better optimized code.

Speaking of which...when it comes to code Optimization, Watcom C++ is the best...and it's even open source...
Was This Post Helpful? 0
  • +
  • -

#8 poke_blade  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 21
  • Joined: 26-February 06

Re: If/Else Conditional Statement in C++

Posted 18 March 2006 - 11:17 AM

Do you have any link where I can download watcom c/c++
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1