Ah where to begin:
1. void main is wrong it is int main!
2. If you are going to use standard headers do it this way
#include <iostream>
using namespace std;
3.Use code tags like I did above they make everyone who reads your post happy. Read This .
As for your question to declare an instance of your class you just do this
#include <iostream>//Ah the way it should be
using namespace std;
class Carpet
{
public:
int lengthInFeet;
int widthInFeet;
int area()
{
return (lengthInFeet * widthInFeet);//return the length times the width
}
};
int main()//A thing of beauty
{
Carpet mainCarpet;//declaring an instance of "Carpet"
mainCarpet.lengthInFeet = 10;//setting the length
mainCarpet.widthInFeet = 6;//setting the width
cout<<mainCarpet.area();//printing out the return value of area
cin.get();
return 0;
}