This program is getting a significant error line.
I am new to the STL library and therefore it is having trouble understanding it. In the code given below, I am trying to use the vector and list STL library and trying to create a proximity list.
#include "stdafx.h" # include & lt; Iostream & gt; #to & lt include, stdio.h & gt; #to & lt include, vector & gt; #includes & lt; list & gt; using namespace std; Zero from add_vertex (Vector & LT; integer & gt; & gt; * adjlist) {adjlist- & gt; Push_back (& lt; integer & gt; () of the list); // adding peak} zero add_edge ( from the & vector & lt; list; * adjlist, int x, int y) {adjlist [x] .push_back (y); // adding edge // ^^^^ some error here ^^^^} int main (int argc, char * argv []) {int t, n, i, j; Int's [500], D [500]; Int max = 0, TMPL; // int vertex [500] = {0,}; Of vector & lt; & Lt; Int & gt; & Gt; Adjlist; // adjacency list scanf ("% d", & amp; t); {Scanf ("% d", & amp; n) for (i = 0; i & lt; t; i ++); For (j = 0; j; l; n; j ++) {scanf ("% d% d", and [j], & amp; d [j]); TMPL = (S [J]> G [J]] S [J]: D [J]; If (max Adjlist [x] .push_back (y); to
(* adjlist) [x] .push_back (y); But in any case, it would be better to define the function and other similar functions because of the first parameter of reference to vector types different from the vector and vector indicator type. For example, zeros add_edge (
Comments
Post a Comment