Good Afternoon,
I'm reviewing structs, but don't get the concept very well.
Assume the following structure declaration is given
struct Rectangle
{
int length;
int width;
};
write a function that returns a Rectangle structure. The function should store the user's input in the members of the structure before returning.
So far I have this but it doesn't work.
int input(struct Rectangle*rect)
{
int l,w, area;
cout<<"Enter a length:";
cin>>l;
cout <<"enter a width:";
cin>>w;
area = l*w;
return area;
}