Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- struct Circle{
- float area;
- float radius;
- Circle(float r): //c'tor
- radius(r),
- area(3.14 * r * r)
- {}
- };
- int main(){
- Circle c(3.16227766);
- std::cout << c.area << " (should be 31.4)" << std::endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement