Re: If statements inside switch statements?

  • From: Jes <theeternalkid@xxxxxxxxx>
  • To: programmingblind@xxxxxxxxxxxxx
  • Date: Tue, 27 Jul 2010 01:23:21 -0400

Sorry it's taken me so long to get back.
Bill, I am using C++.
Here is the sample code that I am trying to compile:
if (nights <= 0)
{
cout << "Error, must be greater than 0. ";
else if (nights == 1)
{
cout << "You have selected to stay for a single night. ";
else if (nights > 1)
{
cout << "You have selected to stay for "; cout << nights; cout << "nights. ";

] //end if


On Jul 26, 2010, at 3:39 PM, Bill Gallik wrote:

> Whoa, whoa, whoa; are you saying the "else" portion of your code doesn't 
> compile but the rest does?
> 
> Which programming language are you using?
> 
> If it's C or C++ send me a snippet of this code and I'll give it a look 
> because this doesn't seem plausible.
> ----
> Holland's Person, Bill
> E-Mail: BillGallik@xxxxxxxxxxxxxx
> - The early bird may get the worm, but the second mouse gets the cheese! 
> __________
> View the list's information and change your settings at 
> //www.freelists.org/list/programmingblind
> 

__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind

Other related posts: