cpp:class_templates
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
cpp:class_templates [2019/05/03 15:04] – gthanos | cpp:class_templates [2019/05/04 04:25] – [Templates κλάσεων] gthanos | ||
---|---|---|---|
Line 33: | Line 33: | ||
</ | </ | ||
- | H παραπάνω κλάση μπορεί να παράγει διαφορετικούς τύπους δεδομένων, | + | H παραπάνω κλάση μπορεί να παράγει διαφορετικούς τύπους δεδομένων, |
<code cpp BoxUsage.cpp> | <code cpp BoxUsage.cpp> | ||
Line 46: | Line 46: | ||
Box< | Box< | ||
Box< | Box< | ||
- | Student | + | Student |
- | Box< | + | Box< |
+ | Student katherine = studentBox.get(); | ||
+ | katherine.setName(" | ||
+ | |||
+ | cout << kate << endl; | ||
+ | cout << katherine << endl; | ||
+ | cout << studentBox.get() << endl; | ||
} | } | ||
</ | </ |
cpp/class_templates.txt · Last modified: 2020/05/25 06:52 (external edit)