This commit is contained in:
2026-03-03 19:54:28 +01:00
parent 4c31567c91
commit 119c8ca85d
5 changed files with 156 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
#include <iostream>
#include <string>
class Klasa {
public:
std::string tekst;
Klasa(std::string &str) {
tekst = str;
std::cout << "Tekst który podałeś przy tworzeniu klasy to: " << str <<
std::endl;
}
void wyswietl_tekst() { std::cout << "Tekst to: " << tekst << std::endl; }
};
int main() {
std::string tekst = "abc";
Klasa k(tekst);
k.wyswietl_tekst();
}