Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #include <iostream>
- #include <cstring>
- #include "stdio.h"
- #include <conio.h>
- using namespace std;
- class tekst {
- char *p;
- public:
- tekst() {
- p = new char[1];
- }
- void assign(char *t) {
- strcpy(p, t);
- }
- tekst(char *t) {
- p = t;
- }
- void operator+(tekst const &a) {
- strcat(this->p, a.p);
- }
- void operator=(tekst a) {
- strcpy(p, a.p);
- }
- void print() {
- cout << p << endl; //użyć printf bo cout ssie
- }
- void operator!() {
- cout << this->p << endl; //tu to samo
- }
- };
- int main()
- {
- tekst a, b, c;
- b.assign("Tekscior"); //tu może wywali błąd ale podobno jest ładnie więc co sie bede kłócił
- b.print();
- a = b;
- !a;
- _getch();
- a.assign("Tekst");
- !b; !a;
- c=a+b;
- !c;
- _getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement