Re: Ndihme!!! Me c++
Shiqo kodin me poshte:
Shiqo kodin me poshte:
Code:
// deklarimi i klases
class x
{
private:
char* ch1;
public:
x(char* );
x(void) { x(""); }
char* display(void);
};
// implementimi i klases
x::x(char* nm)
{
ch1 = new char[20];
strcpy(ch1, nm);
}
char* x::display(void)
{
return ch1;
}
// testimi i klases
char* t;
x var1("fitim");
t = var1.display();
printf(t);