mirror of
https://github.com/szymon-jozef/ZUT-notatki.git
synced 2026-09-07 12:10:40 +02:00
22 lines
401 B
C++
22 lines
401 B
C++
#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();
|
|
}
|