and i have to build 2D array n*n and n value must enterd by the user
after that i have to ask the user to enter the starting and the ending points
then i have to make a robot to walk from the starting point to the ending point
automatically
#include<iostream>
#include <cstdlib>
#include <ctime>
#include "node.h"
usingnamespace std;
int main ()
{
int n , m ,x , y , w , z , s , e , o , k , l , ** Array ;
cout<<"Please Enter The Value Of The Columns : " << endl;
cin>>n;
{
m=n;
Array = newint*[n];
for(int i = 0; i < n; ++i)
Array[i] = newint[m];
}
cout<<"What Is The Starting Point ??"<<endl;
cin>> x;
cin>> y;
Array[x][y]={6};
cout<<"What Is The Ending Point ??"<<endl;
cin>> w ;
cin>> z ;
e=Array[w][z];
e=6;
for(int i=0; i<n; i++) //This loops on the rows.
{
for(int j=0; j<n; j++) //This loops on the columns
{
cout << Array[i][j] << " ";
}
cout << endl;
}
/*
srand(time(0));
o=(n*n)/4;
Array[k][l]= (rand()%o) ;
for (int i=0 ; i < o ; i++)
{
cout<< Array[k][l]<<endl;
} */
getchar();
return 0;
}
my question is how to define the starting and ending points and there value enter by the user ??
and my second question is my code good or not ??
and i get this error in line 21
21 16 extended initializer lists only available with -std=c++11 or -std=gnu++11