Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class macierz{
- static const int DEFAULT = 1;
- private:
- double **tab; //wskaźniki
- int m_height; //wysokość macierzy
- int m_width; //szerokość macierzy
- public:
- macierz(); //konstruktor domyślny
- };
- macierz::macierz(){
- m_height = 1;
- m_width = 1;
- tab = new double*[DEFAULT];
- for (int i = 0; i < DEFAULT; ++i )
- tab[i] = new double[DEFAULT];
- //wpisanie wartości
- for (int i = 0; i < m_height; i++)
- for (int j = 0; j < m_width; j++)
- tab[i][j] = j+1;
- //wypisywanie
- for (int i = 0; i < m_height; i++){
- cout << "\n";
- for (int j = 0; j < m_width; j++)
- printf("%2g \n", tab[i][j]);
- }
- }
- int main(){
- macierz a();
- macierz kopia_a( a );
- cout << "\nKoniec programu.\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement