Quick Question

I was wondering if you could ask question about C# here? or is there a website similar to this one for C# questions and such?
if your on the beginner forum pretty much no one knows nothng about c# so maybe if you went higher up someone would know stuff
closed account (S6k9GNh0)
You may get away with asking about C++/CLI but C# is completely different from C and C++.
#include <iostream.h>
#include <conio>
class crectangle
{
private:
int width,height;
public:
crectangle(int w,int h)
{
width=w;
height=h;
}

int area()
{
return (width*height);
}

void display()
{
cout<<width<<":"<<height;
}

crectangle( csquare sq )
{
int csq=sq.area();
width=(csq/4);
height=(csq/4);
}

};
class csquare
{
private:
int side;
public:
csquare(int a)
{
side=a;
}
void display()
{
cout<<side;
}
operator crectangle() const
{
int width=side;
int height=side;
return crectangle(width,height);
}
};
void main()
{
csquare sq(4);
crectangle rt=sq;
sq.display();
rt.display();
getche();
}

only one error in this program can any one help me to resolve this problem??
You cannot pass an object before it is even declared...like you did with scquare object in crectangle constructor! You can use forward declaration of csquare class before crectangle class (not sure 100% if that will work) or create a function outside classes to return your desired result!
Some of us do know some C#, if you must ask here (msdn may be better) post in the lounge.
Topic archived. No new replies allowed.