mirror of
https://github.com/szymon-jozef/ZUT-notatki.git
synced 2026-09-07 20:20:39 +02:00
rzeczy
This commit is contained in:
21
uczelnia/2_semestr/programowanie/laby/lab1/main.cpp
Normal file
21
uczelnia/2_semestr/programowanie/laby/lab1/main.cpp
Normal 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();
|
||||
}
|
||||
Reference in New Issue
Block a user