prog.cpp:4:1: error: ‘cout’ does not name a type
cout<<"enter the number of vertics";
^~~~
prog.cpp:5:1: error: ‘cin’ does not name a type
cin>>n;
^~~
prog.cpp:7:10: error: array bound is not an integer constant before ‘]’ token
int arr[n][n];
^
prog.cpp:7:13: error: array bound is not an integer constant before ‘]’ token
int arr[n][n];
^
prog.cpp:8:12: error: array bound is not an integer constant before ‘]’ token
int visit[n];
^
prog.cpp: In function ‘void enqueue(int)’:
prog.cpp:15:2: error: reference to ‘queue’ is ambiguous
queue[rear]=data;
^~~~~
prog.cpp:11:5: note: candidates are: int queue [100]
int queue[100]={-1};
^~~~~
In file included from /usr/include/c++/6/queue:64:0,
from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:86,
from prog.cpp:1:
/usr/include/c++/6/bits/stl_queue.h:96:11: note: template<class _Tp, class _Sequence> class std::queue
class queue
^~~~~
prog.cpp: In function ‘int dequeue()’:
prog.cpp:20:9: error: reference to ‘queue’ is ambiguous
return queue[front-1];
^~~~~
prog.cpp:11:5: note: candidates are: int queue [100]
int queue[100]={-1};
^~~~~
In file included from /usr/include/c++/6/queue:64:0,
from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:86,
from prog.cpp:1:
/usr/include/c++/6/bits/stl_queue.h:96:11: note: template<class _Tp, class _Sequence> class std::queue
class queue
^~~~~
prog.cpp: In function ‘void BFS(int)’:
prog.cpp:25:2: error: ‘visit’ was not declared in this scope
visit[index]=1;
^~~~~
prog.cpp:36:12: error: ‘arr’ was not declared in this scope
enqueue(arr[index][j]);
^~~
prog.cpp: In function ‘int main()’:
prog.cpp:48:8: error: ‘arr’ was not declared in this scope
cin>>arr[i][j];
^~~