"My definition of an expert in any field is a person who knows enough about what's really going on to be scared." -- P.J. Plauger
![]() |
Reminder: These notes will be taken down permanently on Friday, April 28, 2017. If you want to save a copy for yourself, please download them before that time. |
![]() |
Information
If you have any questions about any assignment, please post the questions in the CS170 Forum on the CS170 Moodle website. There are many people that can answer your question. If you just send your question to me in an email, it may be a while until (or if) I get back to you. Also, if you have a question about the assignment, it's very likely that many other students have the same question and they will benefit from the posted answers.
References
Required Software (free)
The zip file contains version 5.4.0 of the GNU C/C++ compilers and command-line utilities. The zip file is about 530 MB and extracts to about 1.5 GB. Creates a folder named cygwin64 on the C: drive.
This will list all of the directories in the PATH with each on a separate line. That is:path | tr ; "\n"
Token Meaning path Displays the PATH as one long line | A vertical bar (pipe symbol), usually on the key with the backslash (\) tr The translate command ; A semi-colon (usually to the right of the letter 'L' on the keyboard). On Linux and Mac OS X it's a colon instead. "\n" A double quote, backslash, lowercase letter 'N', double quote
Version 5.4.0 is what is installed with Cygwin on the computers at Digipen. That's also the
version in the download for Cygwin. For non-Windows users, if you can't get version 5.4.0,
any 5.x.x version will probably be fine. We won't be using any of the advanced features of
C++ that are in 5.x, but you do want to have the closest version possible so that you will
get the same errors and warnings that 5.4.0 emits.
For Linux people, I recommend Linux Mint 18, which comes with version 5.4.0, although any
distribution that includes that compiler version will work.
This is the compiler that comes with Visual Studio 2015 and is installed here. This is supposed to be the default compiler (64-bit) when you open a command window. If it isn't, you must first type setvc14 to enable the command line tools for this version. If you want the 32-bit compiler, you need to type setvc14-32. You need to do this everytime that you open a command window. As long as you don't close the window, the command line tools will be enabled. This compiler is only necessary for you to use the memory debugger (Dr. Memory) on Windows.
If you are having problems configuring your personal computer to use Microsoft's compiler from the command line look at this page. It's for previous versions of VS, but it should get you started. You can Google for more information or visit the Academic Support Center for more help. If you installed VS to the default directory on the C: drive, you can grab the batch file named setvc14-32.bat and setvc14-64.bat from one of the computers in Edison. The file are in the C:\utils directory (along with a bunch of others). These batch files will enable their respective compiler environments when working on the command line. You need to put them in a directory that is in your PATH.
- mem.leaks.cpp Sample program to test out the memory debuggers. Here's a simpler one: mem.bugs.cpp.
- Command line switches for Dr. Memory.
- Documentation, especially how to build your program with each compiler.
- A technical document from the authors of the tool. It gets a little technical, but interesting for those that might want to write their own memory debugger at some point in the (distant!) future.
Other useful stuff:
Notes
Homework Assignments
Please remember that all programs absolutely, positively, MUST compile cleanly with g++. If the g++ compiler gives a warning or error, you'll get an automatic 0 on the assignment. (Note, however, that since we're using a submission server that will compile and link your code, you won't be able to submit anything with warnings or errors.)
Sample command lines for compiling/linking source file source.cpp into hw1.exe:
GNU g++:g++ -o hw1 source.cpp -Wall -Werror -Wextra -ansi -pedantic -O
Microsoft:cl /W4 /EHa /Za /Fehw1.exe /D_CRT_SECURE_NO_DEPRECATE source.cpp
Assignments, Problems and Reading (Nothing to hand in) | Due Date |
---|---|
Read chapters one and two in the textbook and skim over chapter 3 as it's very similar to C.
You can skim over anything that is related to C++ 11 features. I'll be discussing some of those
features later in the semester.
Make sure you can compile with the compilers above. | Friday, January 13, 2017 |
Read Chapters 1 and 2 from The make Manual.
Try to create a very simple makefile and test it. Advanced students can read more, if you're inclined.
Also, take any two of your CS120 assignments/labs (e.g. spellcheck/dumpit) and create a makefile for it. This will show you if you understand the presentation I gave on using make and will prepare you for future labs. | Monday, January 16, 2017 |
Browse through the LLVM (Clang) coding standards. If you think that the CS 120 Style Guide is something arbitrary and antiquated that Mead invented, think again. This is Real World™ stuff that you are learning at Digipen. This will help you look good to a potential employer in an interview (or at least you won't embarrass me!) Some of the topics we haven't talked about yet, but most of it should sound familiar to you. Note: We are not following this guide. It's just meant as an example of what a real company writing real software wants everyone to follow. | Wednesday, January 18, 2017 |
In the Doxygen help file, read all of these chapters: Getting Started,
Documenting the Code (only the C/C++ parts) and Lists. Those that want to use the GUI instead
of the command line can read about the Doxywizard usage.
Browse through these two chapters to get an idea of what Doxygen can do: Configuration and Special Commands Also, take one of your CS120 assignments (e.g. spellcheck) and Doxygenize it. This will show you if you understand how to use Doxygen. | Thursday, January 19, 2017 |
Chapter 9 - Questions: #2, #3, #4 | Monday, January 23, 2017 |
Study Quiz #1 | |
Chapter 8 - Questions: #2, #3, #4, #5 (#6 in 5th edition). Programming: #2 | Friday, February 10, 2017 |
Study Quiz #2 | |
Chapter 10 - Questions: #1-6, #8, #10. | Friday, February 17, 2017 |
Study Quiz #3 | |
Chapter 11 - Questions: #1-7. | Monday, March 13, 2017 |
Chapter 12 - Questions: #1-5. | Wednesday, March 15, 2017 |
Study Quiz #4 | |
Chapter 13 - Questions: #1-12. | Wednesday, March 22, 2017 |
Read Chapter 16, pages 951-968, 978-991 | Friday, March 24, 2017 |
Study Quiz #5 | |
Study Quiz #6 | |
Study Quiz #7 |
Additional Reading Assignments (required)
Interesting reading (optional)
Various Compiler's C++11 support: