Horje
empty 2d array as a member of a class class c++ Code Example
empty 2d array as a member of a class class c++
class Screen {
    private:
        char **data;
        int rows;
        int columns;

    public:
        Screen(int num_rows, int num_cols); 
}; 

Screen::Screen(int num_rows, int num_cols) {
    data = new char * [num_rows];
    for (int i = 0; i < num_rows; ++i) {
        data[i] = new char[num_cols];
    }
    rows = num_rows;
    columns = num_cols;
}




Cpp

Related
how to call subclass override method in c++ Code Example how to call subclass override method in c++ Code Example
math in section title latex Code Example math in section title latex Code Example
prefix using stack Code Example prefix using stack Code Example
"++i + ++i" explanation Code Example "++i + ++i" explanation Code Example
how to take full sentence in c++ Code Example how to take full sentence in c++ Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9