rendered paste body#include <iostream>
#include <fstream>
#include <string>
using namespace std;
class blok
{
private:
int width;
int height;
char block[5][5];
int soort;
char nummer[20];
char txt[10];
char *pad;
public:
void lees_blokken_in(int i);
void bereken_w_h(int i);
void toon_blokken(int i);
blok();
};
blok::blok()
{
nummer [0] = '0';
txt[0] = '.';
txt[1] = 't';
txt[2] = 'x';
txt[3] = 't';
}
blok test[10];
int main()
{
for(int i = 0 ; i < 10 ; i++)
{
test[i].lees_blokken_in(i);
}
for(int i = 0 ; i < 10 ; i++)
{
test[i].toon_blokken(i);
test[i].bereken_w_h(i);
}
return 0;
}
void blok::lees_blokken_in(int i)
{
int lol;
lol = 0;
do
{
test[i].nummer[0]++;
lol++;
}while(lol < i);
test[i].pad = strcat(test[i].nummer ,test[i].txt);
fstream invoer(test[i].pad);
for(int j = 0 ; j < 5 ; j++)
{
invoer >> test[i].block[j];
}
}
void blok::toon_blokken(int i)
{
cout << "blok : " << i << endl;
for(int j = 0 ; j < 5 ; j++)
{
cout << test[i].block[j] << endl;
}
}