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
const reference life time extension
hangman
Visual Studio 2015 Compiler Bug: 64bit multiplication
Implements.cpp
unordered map broken msvc
Is min defined?
ADL of operator expression & unqualified function call
#30.1
Competitive - Algorithm for max number of superior characters
PTaHHHa