Hi All,
I need a translation of this C++ code to understand how Ruby classes
wok.

#include <iostream.h>
class myclass {
  int a;
public:
  int b;
  void setab(int i);
  int geta();
  void reset();
};

void myclass::setab(int i)
{
a = i;
b = i*i;
}

int myclass:: geta()
{
return a;
}

void myclass::reset()
{
setab(0);
}

int main()
{
myclass ob;

ob.setab(5);
cout << "a = " << ob.geta() << '\n';
cout << "b = " << ob.b << '\n';

ob.b = 20;
cout << "a = " << ob.geta() << '\n';
cout << "b = " << ob.b << '\n';

ob.reset;
cout << "a = " << ob.geta() << '\n';
cout << "b = " << ob.b << '\n';

return 0;
}

Thank you.
--
jilani
__________________________________________________
http://space.tin.it/scuola/jkhaldi