#include <iostream>
#include <sstream>
#include <vector>
#define ii pair<int, int>
using namespace std;
// DSK -> DSC
int n;
vector <ii> edge;
string s, num;
int main()
{
cin >> n;
cin.ignore();
for(int i = 1; i <= n; i++)
{
getline(cin, s);
stringstream ss(s);
while(ss >> num)
if(i < stoi(num))
edge.push_back({i, stoi(num)});
}
return 0;
}
error: expected expression
edge.push_back({i, stoi(num)});
^
How can I fix the 'expected expression' error in my graph code when using VSCode to push a std::pair to a vector?
I think you can use make_pair() function.