#include <iostream>
#include <cstring>
using namespace std;
struct stringy {
char * str;
int ct;
};
void set(stringy & stru, char tes[]);
void show(stringy & stru, short x = 1);
void show(char tes[], short x = 1);
int main ()
{
stringy beany;
char testing[] = "Opravdu neni, co byval.";
set (beany, testing);
show(beany);
show(beany,2);
testing[0] = 'D';
testing[1] = 'u';
show (testing);
show(testing, 3);
show("Hotovo!");
delete [] stringy.str; //co tohle?
return 0;
}
void set(stringy & stru, char tes[]){
char * pt = new char [strlen(tes) - 1]; //tuhle pamet potrebuju uvolnit
pt = tes;
stru.str = pt;
}
void show(stringy & stru, short x){
cout << stru.str<<endl;
}
void show(char tes[], short x){
for (int i = 0; i <= x; i++)
cout << tes << endl;
}
Díky moc!