Help with a beginners code???

Hi, I am learning C++, and I am trying to make something to calculate the area of polygons. I am using Dev C++ and it is great, but I don't understand why it will not compile this!


#include <iostream>
#include <stdlib.h>

int main()
{
unsigned short int Apothem = 5, SideLength, SideNumber, Perimeter, Area;
SideLength = 1;
SideNumber = 6;
Perimeter = SideLength * SideNumber;
Area = Perimeter * Apothem * 0.5;

std::cout << "SideLength:" << SideLength << "\n";
std::cout << "Perimeter " << Perimeter << "\n";
std::cout << "Area: " << Area << "\n";
system("pause");
return 0;
}
What error message do you get?
Besides a warning about a conversion from double to unsigned short in the Area calculation, it compiles fine for me on MSVS 2005.
Topic archived. No new replies allowed.