Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using namespace std;
- void FeldInfo(int *Feld, int Breite, int Hoehe);
- int main()
- {
- int Breite;
- cout << "Breite: ";
- cin >> Breite;
- int Hoehe;
- cout << "Hoehe: ";
- cin >> Hoehe;
- int *Feld = new int[Breite*Hoehe];
- FeldInfo(Feld, Breite, Hoehe);
- delete[] Feld;
- cin.sync();
- cin.get();
- return 0;
- }
- void FeldInfo(int *Feld, int Breite, int Hoehe)
- {
- for (int x=0; x<Hoehe*Breite; ++x)
- {
- Feld[x] = x;
- }
- for (int y = 0; y<Hoehe; ++y)
- {
- for (int x = 0; x<Breite; ++x)
- {
- cout << Feld[y*Breite+x] << ' ';
- }
- cout << endl;
- cout << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement