Please read the new rule regarding the restriction on the use of AI tools. ×

I'm getting this error while compiling DFS using c++ on SUBLIME TEXT ..CAN ANYONE HELP?

Revision en1, by rup2003, 2023-09-05 18:30:33

THIS IS MY CODE

include<bits/stdc++.h>

using namespace std;

const int N = 1e5+10; vector g[N]; bool vis[N];

void dfs(int vertex){

cout<<vertex<<"\n";
vis[vertex] = true;
for(int child:g[vertex]){
    cout<<"parent"<<vertex<<" ,child"<<child<<"\n";
    if(vis[child]) continue;

    dfs(child);

}

}

int main(){

int n,m;
cin>>n>>m;
for(int i=0;i<m;i++){
    int v1,v2;
    cin>>v1>>v2;
    g[v1].push_back(v2);
    g[v2].push_back(v1);
}
dfs(1);

return 0; }

OUTPUT

/var/folders/vj/p4j6slg53dn4gvbmstw8gvr00000gn/T//ccHLX1Xy.s:1975:29: error: unexpected token in '.section' directive .section .data.rel.ro.local

Tags help me, sublime text 3, dfs

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English rup2003 2023-09-05 18:30:33 855 Initial revision (published)