Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Code
// Example program #include <iostream> #include <string> using namespace std; float **MATRIX=0; int MATRIX_ROWS, MATRIX_COLS; class matrix { int MATRIX_ROWS=1, MATRIX_COLS=2; public: float **matrix_constructor(int ROWS, int COLS) { int counter=0; float **MATRIX = new float*[ROWS]; for (counter=0; counter < ROWS; counter++) MATRIX[counter]=new float[COLS]; return MATRIX; } void matrix_fill(int ROWS, int COLS) { int counter_rows=0, counter_cols=0; while(counter_rows!=ROWS) { counter_rows++; while(counter_cols!=COLS) { MATRIX[counter_rows][counter_cols]=1; counter_cols++; } } } void matrix_show(int ROWS, int COLS) { }; int main() { cin>>MATRIX_ROWS; cin>>MATRIX_COLS; matrix first; matrix second; first.matrix_constructor(MATRIX_ROWS,MATRIX_COLS); first.matrix_fill(MATRIX_ROWS,MATRIX_COLS); }
run
|
edit
|
history
|
help
0
auto decltype - Return Type Decltype
Waiting for Multiple Objects
Hangman
empty base bug
amusing overload choice
hangman
VC++ Template Comment
Postfix side effect returning 2
primitive type copy constructor
hangman