Welcome to the GDNet C++ Workshop – Ch. 9
For a complete introduction to this workshop, please look here. As well, although this thread is temporarily mirrored in the "For Beginners" forum for easy access, the thread and workshop is actually located in a separate forum called "CPP Workshop" located
Here. You can also find it on the main Forums page at the VERY bottom.
Workshop Overview This workshop is designed to aid people in their journey to learn beginning C++. This workshop is targeted at highly motivated individuals who are interested in learning C++ or who have attempted to learn C++ in the past, but found that without sufficient support and mentoring they were unable to connect all the pieces of this highly complex but powerful programming language. This is a 'guided' self-teaching C++ workshop. Each student is responsible for taking the time to read the material and learn the information. The community and tutors that arise out of this workshop are here for making the learning process run more smoothly, but are not obligated to baby-sit a person's progress. Because everyone will be working from the same textbook (
Teach Yourself C++ in 21 days 5th Ed.), students may find it easier to get answers to the specific questions they might have. There is no minimum age requirement, and there is no previous programming experience required. Additionally, this workshop does not attempt to defend C++ as a language, nor does it attempt to demonstrate that C++ is either more or less useful then other programming languages for any particular purpose. People who intend to start a discussion about the differences between C++ and ANY other languages (except as are relevant to a particular discussion), are encouraged to do so elsewhere. This workshop is for educational, not philosophical discussions.
TutorsFor an in-depth introduction to our tutors, along with the official list, as well as information on how to apply to be a tutor, look here. Over the duration of the roughly 21 weeks of the C++ Workshop there will be many questions asked and (hopefully) many questions answered. Unfortunately, not all answers are created equal. People tend to respond to questions for a number of reasons, not all of which are entirely self-less, and can sometimes even be dangerous to the learning process of those trying to absorb the information. Keep in mind that although your peers on the forum may be anxious and excited to help you, many of them may be learning the information for themselves, and not in a position to claim mastery of the subject. For this reason we’ve decided to establish a list of people we feel to be qualified tutors. People on our list are people we feel have attained a level of mastery such that their answers can generally be accepted as fact. Refer to the link above for the list of workshop tutors.
Quizzes & Exercises Each week will have quizzes and exercises posted in the weekly threads. Please try and answer them by yourself. As well, please
DO NOT post the answers to Quizzes and Exercises within this thread. Once it becomes acceptable to post the answers to quizzes and exercises, an additional thread will be created each week specifically for the purpose of posting quiz answers. If you try with reasonable effort but are unable to answer the questions or complete the exercises, feel free to post a clarification question here on the thread. Tutors, myself, or others will do the best we can to point you in the right direction for finding the answer.
Chapter 9 – Exploiting References
Introduction Jeromy has had a couple issues with his computer and has been absent for a bit, so I'll pitch in with the next weeks thread. You've had a couple week break to absorb and practice with pointers, so hopefully this week will be a bit easier. Pointers have many uses in modern programming and can make very efficient code. References are a new addition to c++ that have some of the same advantages as pointers, but allow for an easier syntax. If you have a good grasp on pointers (which hopefully you do after the last chapter) references should not be too complicated to grasp.
For Tutors Please remember to use OPINION and WARNING tags whenever applicable. As well, feel free to post your own insights, and review questions or exercises beginning Wednesday or Thursday.
Outline of the Reading - Chapter 9- What is a Reference?
- Using the Address-of operator (&) on references?
- Referencing Objects
- Null Pointers and Null References
- Passing Function Arguments by Reference
- Understanding Function Headers and Prototypes
- Returning Multiple Values
- Passing References for Efficiency
- Knowing When to Use References vs. Pointers
- Mixing References and Pointers
- Returning Out-of-Scope Object References
- Pointer, Pointer, Who Has the Pointer
Additional Resources None...
Weekly Errata None...
Good Luck!