Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void funkcja1() {
- cout << "To jest funkcja, ktora nic nie zwraca\n";
- }
- int funkcja2() {
- cout << "Ta funkcja zwraca wartosc 5\n";
- return 5;
- }
- int main() {
- //auto value{ funkcja1() }; nie można nic przypisać do value, gdyż funkcja1 nic nie zwraca (jest typu void)
- auto wartosc{ funkcja2() }; // tutaj da się przypisać wartość, gdyż funkcja2 zwraca wartość typu int
- cout << "Zwrocona wartosc wynosi " << wartosc << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement