Mar 20, 2012 at 4:04pm UTC
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?
Mar 20, 2012 at 5:10pm UTC
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
Mar 20, 2012 at 5:12pm UTC
You may get away with asking about C++/CLI but C# is completely different from C and C++.
Mar 24, 2012 at 9:03am UTC
#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??
Mar 24, 2012 at 4:02pm UTC
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!
Mar 24, 2012 at 4:11pm UTC
Some of us do know some C#, if you must ask here (msdn may be better) post in the lounge.