Skip to content

Assignment 1

guanqin-123 edited this page Apr 7, 2021 · 44 revisions

Assignment-1 folder layout

$tree Assignment-1
├── Assignment-1.cpp
├── Assignment-1.h
├── Test1.h
├── CMakeLists.txt

1. Get the latest code template

* Before coding, please type cd $HOME/SVF-Teaching and git pull in your terminal to make sure you always have the latest version of the code template before each assignment.

2. Assignment 1 task

  • Implement methods printPath and DFS of class GraphTraversal in Assignment-1.cpp.
  • Pass the test without any assertion by Test1.h
  • Submit Assignment-1.cpp to canvas

*You will be working on Assignment-1.cpp only and there is NO need to modify other files under the Assignment-1 folder

3. Configuration && Debugging

You need to set the "program" to be the executable file of Assignment 1, i.e., "${workspaceFolder}/bin/assign-1" in launch.json in order to run and debug

We have also provided one test case in Test1.h and test2.c. You are encouraged to add more test cases by yourself to validate the correctness of your implementation.

2. Debug your code

*If there is an assertion or unexpected output, you will need to debug and find bugs.

Step 1: Set the breakpoint where you want to stop your program and press the 'debug' button

Step 2: 'Step over' /'Step in' / 'Step out'

  • 'Step over' to the next step of your program
  • 'Step in' to the current line of your program
  • 'Step out' to mainstream of your program where you stepped in before

Step 3: Watch the value of a variable you are interested in.


*Browse more information about C++: free tutorial that runs C++ code in exercises

Clone this wiki locally