Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Why is c++ weird?

Name: Eamon 2012-08-28 19:39

Why is this line ok:

long double x = (1 / sqrt(2));

but this one isn't:

long double x = (1 / 4);

?

Name: PROUD OF SEPPLES 2012-08-29 13:16

enum AnimalFlags
{
    HasClaws = 1,
    CanFly =2,
    EatsFish = 4,
    Endangered = 8
};

AnimalFlags seahawk = CanFly | EatsFish | Endangered; // error
AnimalFlags seahawk = static_cast<AnimalFlags>(static_cast<int>(CanFly) | static_cast<int>(EatsFish) | static_case(Endangered)); // ok

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List