2010-09-27, 10:28 AM
Your comment helped me a bit Eosian... but damn there's just so much back and forth lol.
so it goes something like
-1234 is passed into function setIdNum (declared in the class)
-inside that function, 1234 is stored into idNum (doing it this way is the only way to store a value into the private idNum?)
-then displayStudentData is run in the main
-since displayStudentData is part of the class, it can display idNum in the cout.
if that's right, then yeah... there's a lot of back and forth. This is definitely the hardest thing for me to grasp out of all the programming things I've learned so far. It looks like the number is asked for (in this case just given) in the main, but to store it in the private int idNum of Student, it needs to pass through a function that's also part of Student.
this is going to take a lot of practice to get this down......
so it goes something like
-1234 is passed into function setIdNum (declared in the class)
-inside that function, 1234 is stored into idNum (doing it this way is the only way to store a value into the private idNum?)
-then displayStudentData is run in the main
-since displayStudentData is part of the class, it can display idNum in the cout.
if that's right, then yeah... there's a lot of back and forth. This is definitely the hardest thing for me to grasp out of all the programming things I've learned so far. It looks like the number is asked for (in this case just given) in the main, but to store it in the private int idNum of Student, it needs to pass through a function that's also part of Student.
this is going to take a lot of practice to get this down......

