Getting Help with Homework 5
Ask your Homework 5 questions here. Use the box at the bottom of this page. Your question is posted to this page for the class to see, under an animal name rather than your own—and if you would rather only the course staff saw it, there is a box to tick for that.
Course staff read this page. So do your classmates, and a classmate answering first is a good outcome rather than a failure of the system.
Meh. Why not just email somebody?
Because one answer here reaches everyone with the same problem, and a lot of people hit the same linked-list and iterator snags within an hour of each other.
So if my
IntListis segfaulting, somebody else probably is too?
Almost certainly. That is exactly the kind of question that is worth asking in public.
Before you ask
- Re-read the part you are on, and check the
IntListand iterator encodings you drew — a surprising number of bugs are really encoding misunderstandings. - Compile on the CS 70 server, and read the first error, not the last one.
- If your program crashes or leaks, run it under
valgrindand include what it says — the line it points at is usually the real clue. - If your question is about a lesson rather than the assignment, ask on that lesson's Key Points page instead, where it sits next to the material.
Asking a question we can actually answer
- Push your code first. Commit, push, and say so — then whoever picks up your question can look at the real thing rather than at a description of it.
- The exact command you ran—pasted, not summarised.
- The exact output, error, or
valgrindreport, in full, in a ``` code block. The useful line is often not the last one, so paste all of it. - What you expected instead, and what you have already tried.
Things that go wrong on Homework 5 specifically
- Segfaults and memory errors in the linked list. Draw the memory diagram
for the exact operation that crashes, and run it under
valgrind. - Memory leaks. The destructor, copy constructor, and assignment operator
are the usual suspects — say which
valgrindblames. - Iterator bugs. Say what you expected the iterator to point at and what it actually did, at which step.
- Your tests pass but the autograder disagrees. Remember we test your tests against buggy implementations — think about what observable outcome you have not yet written a test for.
- Your partner's copy works and yours doesn't. Usually one of you has not pulled the other's latest commits. Pull first, then say what still differs.
When a conversation would be faster
- Ask in lab, especially for anything where someone looking at your screen beats a paragraph of description.
- Come to grutoring or office hours for anything conceptual, or for the questions that are hard to phrase.
- For anything personal, or about the course rather than the code, contact a professor directly.
(When logged in, completion status appears here.)