Instrukcji. Rysunek 5.3 przedstawia nagłówek
Instrukcji. Rysunek 5.3 przedstawia nagłówek i ciało funkcji.
Rysunek 5.3. Nagłówek i ciało funkcji
Listing 5.1 demonstruje program zawierający prototyp oraz deklarację funkcji Area().
Listing 5.1. Deklaracja i definicja funkcji oraz ich wykorzystanie w programie
0: // Listing 5.1 – demonstruje użycie prototypów funkcji
1:
2: #include
3: int Area(int length, int width); //prototyp funkcji
4:
5: int main()
6: {
7: using std::cout;
8: using std::cin;
9:
10: int lengthOfYard;
11: int widthOfYard;
12: int areaOfYard;
13:
14: cout <> widthOfYard;
16: cout << “nJak dlugie jest