11.07.2015 Views

tYSR20

tYSR20

tYSR20

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

254Part III: Introduction to ClassesIn fn(), noOfStudents is referenced using the object s1. But s1 and s2share the same member noOfStudents. How did I know to choose s1? Whydidn’t I use s2 instead? It doesn’t make any difference. You can reference astatic member using any object of that class, as illustrated here:// ...class defined the same as before...void fn(Student& s1, Student& s2){// the following produce identical resultscout

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!