Witam,
Program sie kompiluje ale w momencie wyskoczenie okna konsoli sie crashuje. Prosze o pomoc.
// Dziedzidżenie_1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <conio.h>
#include <stdio.h>
#include <iostream>
using namespace std;
class Macierz
{
private:
int w;
int k;
double **tablica;
double value;
public:
Macierz(int Nw, int Nk);
int Wiersze(){return w;};
int Kolumny(){return k;};
void Wyswietl();
};
Macierz::Macierz(int Nw, int Nk)
: w(Nw),
k(Nk)
{
if(w<1||w>100||k<1||k>100){exit(0);};
double **tablica=new double*[w];
for(int i=0; i<w; i++)
{
tablica[i]=new double[k];
}
for(int i=1; i<w; i++)
{
for(int j=1; j<k; j++)
{
tablica[i][j] = 0;
}
}
}
void Macierz::Wyswietl()
{
for(int i=1; i<w; i++)
{
for(int j=1; j<k; j++)
{
cout<<tablica[i][j]<<endl;
}
}
}
int _tmain(int argc, _TCHAR* argv[])
{
Macierz v1(10, 10);
v1.Wyswietl();
_getch();
return 0;
}