small question with class

javascript:tx('code')
#include "stdafx.h"
#include "iostream"
using namespace std;
class rectangleclass
{
int w,h;
public:
void setnum(int x, int y)
{
w=x;
h=y;
}
int area()
{
return w*h;
}
};
int main()
{
rectangleclass ra;
ra.setnum(7,2);
cout<<ra.area();
return 0;
}
javascript:tx('code')
is it well written ?
will it work ?
Topic archived. No new replies allowed.