Welcome to the GDNet C++ Workshop – Ch. 1 & 2
For a complete introduction to this workshop, please look here.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. Quizzes & Exercises Each chapter will have quizzes and exercises. Please try and answer them by yourself. 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 1 – Getting Started, Chapter 2 – The Anatomy of a C++ Program
Introduction Greetings! Most weeks will be 7 days, beginning on Monday and ending on Sunday, however as this week starts on Thursday, and is the first “week” in the class, we will extend it to a full 10 days to get on a better schedule and give people a chance to obtain their textbooks in the mail. Additionally, as the topics are relatively straight forward, requiring little programming, etc…Week 1 will be a combination of the first 2 chapters. Chapter 1 is about 16 pages and chapter 2 is an additional 14 pages. Participants have 10 days ( ending Sunday, June 10th ) to read the first two chapters, at which point we will move on to the next chapter. Participants are welcome to post their questions for these chapters within this thread and myself, the tutors, and other participants will do the best we can to answer your questions. As the thread is likely to grow to a hundred or more posts, the C++ workshop threads will be closely moderated. Discussions which become narratives, flame-wars, or philosophical will either be removed or moved to another forum, unless entirely relevant to the current chapters. If you have trouble installing your compiler or getting “Hello World” to build, please ask for help. You will not be able to move forward with the workshop until you’ve done those two tasks successfully. Good Luck! Finally, feel free to post quiz-like questions after about 5 days. This will give people an opportunity to test their knowledge and understanding after they’ve had a chance to absorb the information. For questions which require further research then what is in the book, mark the question with an [Extra Credit] tag. Topical Outline of the Reading (Not literal due to copyrights)- A History of C++
- Which language should be learned first C or C++?
- How does C++ compare to Java and C#?
- An introduction to Managed C++
- The ANSI Standard
- Getting in the right mindset to program
- How an .exe gets created
- Building your first program. – “Hello World”
- An introduction to compiler errors
- A review of Hello World
- An introduction to “Console Out”
- An introduction to the Standard Namespace
- Commenting your code
- An introduction to functions
- The difference between Methods and Functions
Creating and Building a Project w/ VC++ .NET 2005
It has come to my attention that the instructions for creating a project/file in the book on pages 19-20 are for Visual C++ 6. Visual C++ .NET 2005 is actually version 8. The correct approach for .NET 2005 is: Step 1: Create an empty project- File->New->Project
- Select 'Win32' from Project types
- Select 'Win32 Console Application' from the Templates
- Type the name of the project and the location in the edit box near the bottom.
- Click OK
- When the dialog box appears click on "Application Settings" on the left
- Click "Empty Project" under Additional options.
- Click Finish
- Right click on your project in the Solution Explorer
- Add->New Item
- Click Code in the Categories List
- Select either C++ File or Header File as appropriate to the task
- Type the name of the file in the edit box near the bottom.
- Click Add
Week 1 Errata Chapter 1, Exercise 1 says "...try to guess what it does without running it." If you DO put it into a compiler it will give you a compile error as the listing is not correct. The author meant:
#include <iostream>
int main()
{
int x = 5;
int y = 7;
std::cout << std::endl;
std::cout << x + y << " " << x * y;
std::cout << std::endl;
return 0;
}
Note that 'endl' is also part of the Standard Namespace, and thus requires std:: at the beginning. [Edited by - jwalsh on May 30, 2007 5:25:07 PM]