A question about debug on devc++ when I use c++

33 Views Asked by At

I don't know how to debug a vector on devc++, I used following methods to try to figure out the values in arr, but it failled.

That's my codes

#include<stdio.h>
#include <iostream>
#include<vector>
using namespace std;
  int main(){
        vector<int> arr(3);
        arr[0] = 0,arr[1]=1,arr[2]=3;
        printf("aaaa");
      return 0;
  }

I made a breakpoint on printf(). The following snippets are my errors.

enter image description here

It can work on VS2019. Because of my college, I have to use the devc++.

1

There are 1 best solutions below

1
N0zye On

to debug the vector you just need to add a watch with just the name, and if i remember correctly it should show the size and all the elements inside the vector.