Well, like the title says, I have constructed a program, my first one using classes, and my problem is that the program ends right after the user enters two values (the side lengths of a rectangle) and doesn't display the final output: the area of the rectangle.

It's meant to take in two values from the user (the sides of a rectangle), declared in main() by i and j. It then sends those values into a function in the class CRectangle (the function is get_values( int , int ) ) which subsequently assigns them to values within the class, x and y. Skipping back to main(), the function area() is declared, which multiplies x by y and returns the value to cout.

Here's the code:

//Rectangle class

#include <iostream>

using namespace std;

class CRectangle 
    int x , y;
    void get_values( int , int );
    int area() { return ( x * y ); }

void CRectangle::get_values( int a , int b )
    x = a;
    y = b;

int main()
    int i , j;
    CRectangle rectangle;
    cout << "Enter the lengths of the two sides of a rectangle: ";
    cin >> i , j;
    rectangle.get_values( i , j );

    cout << "The rectangle's area is " << rectangle.area();
    return 0;
I just need to get it to finish the program; it always ends too early. Thanks!