35 lines
452 B
C++
35 lines
452 B
C++
|
#include <iostream>
|
||
|
#include <cstdlib>
|
||
|
#include <cstring>
|
||
|
|
||
|
using namespace std;
|
||
|
|
||
|
class SLink
|
||
|
{
|
||
|
private:
|
||
|
char *title;
|
||
|
|
||
|
public:
|
||
|
SLink() {}
|
||
|
SLink(const char *title)
|
||
|
{
|
||
|
this->title = (char *)malloc(50);
|
||
|
strcpy(this->title, title);
|
||
|
}
|
||
|
~SLink();
|
||
|
void show()
|
||
|
{
|
||
|
cout << title << endl;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
SLink::~SLink() {}
|
||
|
|
||
|
int main()
|
||
|
{
|
||
|
SLink s1;
|
||
|
SLink s2("disen 补课中");
|
||
|
s2.show();
|
||
|
return 0;
|
||
|
}
|