Untitled

 avatar
user_9831585
plain_text
a year ago
1.1 kB
2
Indexable
Never
#include <iostream>
void initialization(int& row , int& col);
void Enter_values(char** matrix , int& row , int& col);

int main()
{
    int row = 0;
    int col = 0;
    std::cout<<"Enter number for row and for col -> "<<std::endl;
    std::cin>>row>>col;
    initialization(row,col);
}
void initialization(int& row , int& col)
{
    char** matrix = 0;
    matrix = new char*[row];
    for (int i = 0; i < row; ++i)
    {
        matrix[i] = new char[col];
    }
    for (int i = 0; i < row; ++i)
    {
        for (int j = 0; j < col; ++j)
        {
            matrix[i][j] = 0;
            std::cout<< "  |__ " << matrix[i][j];
        }
        std::cout<<std::endl;
    }
    std::cout<<std::endl;
    std::cout<<std::endl;
    std::cout<<std::endl;
    std::cout<<std::endl;
    Enter_values(matrix, row, col);
 
}
void Enter_values(char** matrix , int& row , int& col)
{
    char tav = NULL;
    
    do
    {
        std::cout<<"Enter your tav -> "<<std::endl;
        std::cin>>tav;
        
    }
    while ((tav != 'G') || (tav != 'M') || (tav != 'C') || (tav != 'R'));
}