Polymorphism \ Overloading

So I've been reading and watching a bit of
videos about polymorphism but, would like to know
how would it be effective in a practical program.
I've been working on this "juvenile delinquent" program
below. I think I have to concept correct but, am I missing somthing ?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
  #include <iostream>
#include <string>
using namespace std;

//samthewildone
//POLYMORPHSIM + OVERLOADED FUNCTIONS
//POINTERS + MEM ADDRESSES
//CLASSES

int numberint(int n1, int n2, int n3);
int numberint(int n1, int n2, int n3, int n4);
int numberint(int n1, int n2, int n3, int n4, int n5);




int main()

{ 
   int numPointer = 100;
   int *pointer = &numPointer; // Pointer is MEM ADDRESS to numPointer
   int n1 = 10;
   int n2 = 20;
   int n3 = 30;
   int n4 = 40; 
   int n5 = 50;
  
   
   cout << numberint(n1,n2,n3) << endl;   // ORGINAL FUNCTION 
   cout << numberint(n1,n2,n3,n4) << endl; // OVERLOADED NUMBERINT
   cout << numberint(n1,n2,n3,n4,n5) << endl; // OVERLOADED NUMBERINT
   cout << numberint(n4,n5,n1) << endl;   // IDK WHAT THIS IS (OVERLOADED ?)
   cout << numberint(n1,n4,n2) << endl; // IDK WHAT THIS IS (OVERLOADED ?)
   cout << &numPointer << " is the MEM ADDRESS of numPointer using & == ADDRESS " << endl; //mem ADDRESS of numPointer
   cout << pointer     << " is the MEM ADDRESS of numPointer " << endl;     //mem ADDRESS of numPointer
   cout << *pointer    << " is the VALUE of numPointer" << endl;    //mem VALUE for  numPointer == 100
  

return 0;
}

// INT with 3 arguments
int numberint(int n1, int n2, int n3)
{
   //n1 = 10;
   //n2 = 20;
   //n3 = 30;

return (n1+n2+n3);
}



// INT with 4 arguments  + OVERLOADED
int numberint(int n1, int n2, int n3,int n4)
{

   //n1 = 10;
   //n2 = 20;
   //n3 = 30;
   //n4 = 40;

return (n1+n2+n3+n4);
}

// INT with 5 arguments  + OVERLOADED
int numberint(int n1, int n2, int n3, int n4, int n5)
{
   //n1 = 10;
   //n2 = 20;
   //n3 = 30;
   //n4 = 40;
   //n5 = 50;

return (n1+n2+n3+n4+n5);
}




thanks in advance,
samthewildone

Also keeping mind I'm still learning about the core basics with
C++. I'm spending most of my time reading and watching videos to make sure I can get both sides of the story. So concepts of C++ I still question about how would I use in a practical program but, I guess the concepts will become visible with time.
Lines 32 and 33 are not overloaded. They are calls to int numberint(int n1, int n2, int n3);
Topic archived. No new replies allowed.