Skip to content

Commit

Permalink
I like this simple class
Browse files Browse the repository at this point in the history
  • Loading branch information
srinathv committed Feb 9, 2016
1 parent b934633 commit e3ef6bf
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
Binary file removed codingTests/boost/uuid/uuid2
Binary file not shown.
26 changes: 26 additions & 0 deletions codingTests/cplusplus/simpleClass.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// example: class constructor
#include <iostream>
using namespace std;

class Rectangle {
int width, height;
public:
Rectangle (int,int);
int area () {return (width*height);}
~Rectangle ();
};

Rectangle::Rectangle (int a, int b) {
width = a;
height = b;
}

Rectangle::~Rectangle() {}

int main () {
Rectangle rect (3,4);
Rectangle rectb (5,6);
cout << "rect area: " << rect.area() << endl;
cout << "rectb area: " << rectb.area() << endl;
return 0;
}
Binary file modified codingTests/cplusplus/testenv
Binary file not shown.

0 comments on commit e3ef6bf

Please sign in to comment.