To write a complete C++ program that will find “hidden” words in a rectangle of letters. The words may appear in any direction (up, down,
forward, backward, or any diagonal) but always in a straight line
# include <iostream>
usingnamespace std;
int main ()
{
//initialize the matrix
char** Matrix; //A pointer to pointers to an int.
int x;
int rows,columns,i, j;
/*cout<<"Enter number of rows: ";*/
cin>>rows;
/*cout<<"Enter number of columns: ";*/
cin>>columns;
Matrix = newchar*[rows];
//define the matrix
for(i=0;i<rows;i++)
{
Matrix[i]=newchar[columns]; //the ith array is initialized
for( j=0;j<columns;j++) //the i,jth element is defined
{
cin>>Matrix[i][j];
}
}