C 2D Array, Elemente die "plätze tauschen lassen"

SparkMonkay

Commander
Registriert
Feb. 2013
Beiträge
2.337
moinsen!

ich wollte ein kleines spiel, dass in der konsole läuft, erstellen.
es ergibt sich jedoch bei mir das problem, wie lasse ich meine einheit sich bewegen?

ich habe mein feld erstellt, nun möchte ich das'@' rumlaufen lassen

BTW:
es handelt sich nicht um hausaufgaben!


mein code sieht folgendermaßen aus
Code:
#include <stdio.h>
#include <stdlib.h>

int main()
{

/*The Map*/
char map [5][5]={
    {'#','#','#','#','#'},
    {'#',' ',' ',' ','#'},
    {'#',' ',' ',' ','#'},
    {'#',' ',' ','@','#'},
    {'#','#','#','#','#'} };
/*X/Y coordinates for the map*/
int y;
int x;
unsigned int life=100;
/*BTW INFINITE LOOP!!!!!*/
while(life!=0){
system("cls");
/*The loop for printing the 2d array*/
for (y=0; y<5;y++ )  {
      for (x=0; x<=5;x++){
            if(x<5){
            printf("%c", map[x][y]);
                    }
/*breaking the line for correct printing of the map*/
            else
            printf("%c\n", map[x][y]);
                    }
      }
/*making able to move a unit, you*/
char a;
a=getchar();
    if(a=='w'){
       //nach oben bewegen
        
    }
    }
system("Pause");
return 0;
}

kann man mir hier mal ein oder zwei denkanstöße geben?
 
Code:
#include <stdio.h>
#include <stdlib.h>

int main()
{

/*The Map*/
char map [5][5]={
    {'#','#','#','#','#'},
    {'#',' ',' ',' ','#'},
    {'#',' ',' ',' ','#'},
    {'#',' ',' ','@','#'},
    {'#','#','#','#','#'} };
/*X/Y coordinates for the map*/
int y;
int x;
unsigned int life=100;
/*BTW INFINITE LOOP!!!!!*/
while(life!=0){
/*cleares the screen**/
system("cls");
/*The loop for printing the 2d array*/
for (y=0; y<5;y++ )  {
      for (x=0; x<=5;x++){
            if(x<5){
            printf("%c", map[x][y]);
                    }
/*breaking the line for correct printing of the map*/
            else
            printf("%c\n", map[x][y]);
                    }
      }
/*making able to move a unit, you*/
char a;
a=getchar();
    if(a=='w'){
        int c_X_pos, c_Y_pos, n_X_pos, n_Y_pos;
        c_X_pos=4;
        c_Y_pos=4;
        n_X_pos=c_X_pos;
        n_Y_pos=(c_Y_pos-1);
        char temp              = map [c_X_pos][c_Y_pos];
        map [c_X_pos][c_Y_pos] = map [n_X_pos][n_Y_pos];
        map [n_X_pos][n_Y_pos] = temp;
             }
    }
system("Pause");
return 0;
}
so sieht es aus und so sieht die konsole aus
console 1.png
was macht der pfeil da??????

btw, wenn ich erstmals hinbekomme das zum laufen zu bekommen, wird es mit funktionen verschönert ;)
 
btw, wenn ich erstmals hinbekomme das zum laufen zu bekommen, wird es mit funktionen verschönert
Damit tust du dir keinen Gefallen!
Ich mache immer genau das Gegenteil: Struktur ist imho während der Entwicklung viel wichtiger als Funktion
Dh ich würde an deiner Stelle eher das hier hinschreiben, und mir dann zu einem beliebigen späteren Zeitpunkt Gedanken machen wie man switchValues() implementiert.
Code:
if(a=='w')
{
  switchValues(x, y, x, y-1);
}
Bedenke bitte: Was machst du, wenn y bereits 0 ist? 0-1 ergibt dann einen negativen Index und somit einen segmentation-fault, da dein Zugriff nicht im Feld landet.

Außerdem könnte es Sinn machen ein struct zu erschaffen, was aus x und y besteht (zB Position). Dann kann man sowas schönes schreiben:
Code:
Position otherPos = currentPos;
if(a=='w')
{
  otherPos.y -= 1;
}
else if (a=='s')
{
  otherPos.y += 1;
}
switchValues(currentPos, newPos);
Der Vorteil ist, dass der Funktionsaufruf und otherPos nur einmal hingeschrieben werden muss.

Anstatt viele if, else if zu verwenden nimmt man dann üblicherweise switch case.
So wird der Code wunderbar lesbar und auch noch sehr kurz:
Code:
Position otherPos = currentPos;
switch (a) // decide with which other field to switch values
{
  case 'w':
    otherPos.y -= 1;
    break;
  case 's':
    otherPos.y += 1;
    break;
}
switchValues(currentPos, newPos); // do the actual switching of values

Btw: a ist wirklich ein schrecklicher Name für ein gelesenes Zeichen. Man tut sich wirklich überhaupt keinen Gefallen hier die eine Sekunde Zeit zu sparen einen vernünftigen Variablen-Namen zu verwenden! Diese Zeit vergeudet man hinterher zig-fach mehr wenn man dann in einem etwas größeren Programm nicht nur a sondern auch noch die Bedeutung von b, c, d im Kopf haben muss.
"pressedKey" zB wäre doch viel einfacher zu verstehen.
Gerade DASS (Funktionen, Struktur, Benennung, lesbarer Code) sind die Grundlagen die man imho am Anfang unbedingt verinnerlichen sollte. Sonst hat man überhaupt keine Chance etwas größere Dinge zu Programmieren. Dh es nützt sehr wenig, wenn du am Ende zwar ein funktionierendes Programm hast was aber grausam zu lesen ist. Und ein "Mach ich später" ist gerade beim schön-machen der falsche Weg.
 
Zuletzt bearbeitet:
@kanibal, danke, bin immernoch bei den mathematischen matritzen ;)

@kuddlmuddl, ok, werde es erneut versuchen!
und zum 'a'... naja, entschuldigung, wurde zu action umbenannt


//Edit
Ganz neu gemacht, ich habe das initialisieren des Feldes in eine funktion gepackt.
und '@' aus dem "eigentlichen array rausgenommen und seine position mit variablen bestückt.


Code:
#include <stdio.h>
#include <stdlib.h>

void the_map(int x, int y){
//x an y show the position of the '@'
char map [10][10]={
	{'#','#','#','#','#','#','#','#','#','#'},
	{'#',' ',' ',' ',' ',' ',' ',' ',' ','#'},
	{'#',' ',' ',' ',' ',' ',' ',' ',' ','#'},
	{'#',' ',' ',' ',' ',' ',' ',' ',' ','#'},
	{'#',' ',' ',' ',' ',' ',' ',' ',' ','#'},
	{'#',' ',' ',' ',' ',' ',' ',' ',' ','#'},
	{'#',' ',' ',' ',' ',' ',' ',' ',' ','#'},
	{'#',' ',' ',' ',' ',' ',' ',' ',' ','#'},
	{'#',' ',' ',' ',' ',' ',' ',' ',' ','#'},
	{'#','#','#','#','#','#','#','#','#','#'},	
};
map [x][y]= '@';
int a;
int b;
for(a=0;a<10;a++){
	for(b=0;b<10;b++){
		if(b<9){
			printf("%c",map[a][b]);
				}
		if(b==9){
			printf("%c\n",map[a][b]);
				}
			}
		}
	}


int main(){

unsigned int life=100;
while(life!=0){
	if(life<0){
		break;
	}
	system("cls");
	int x=4;
	int y=4;
	the_map(x, y);

char action;
action=getchar();

switch(action){
	case 'w': y-=1; break;
	case 'a': x-=1; break;
	case 's': y+=1; break;
	case 'd': x+=1; break;
			}
}
printf("You have lost!\n");
system("pause");
return 0;
}

mein problem, es bewegt sich nichts....
vorteil. ich brauche keine variablen rotation

//edit, es funktioniert, das '@' bewegt sich :3
 
Zuletzt bearbeitet:
Kein Grund sich für irgendwas zu entschuldigen, jeder hat mal so angefangen ;)

Zum einen: Was für ein Programm (IDE) benutzt du zum Programmieren? Ich kann dir nur raten irgendwas zu verwenden, was es erlaubt den Quelltext automatisch einzurücken. Man erkennt bei deiner Klammerung ja nicht auf den ersten Blick wo die Funktion the_map aufhört.

2) the_map ist auch kein guter Name. Was macht die Funktion wohl, wenn ich mir nur den Namen angucke? Eine Funktion sollte immer nur eine einzige Aufgabe haben und diese Aufgabe sollte schon am Namen erkennbar sein.
Sinnvolle Funktionen bei deinem Projekt wären zB "initMap", "switchValues" und "handleKeypress".

3) Du machst in the_map "int a;"
Kannst du von main aus auf dieses a zugreifen?
Nein, weil a nur innerhalb der Funktion bekannt ist (Scope)
Das gleiche gilt dann leider auch für das hier: "char map [10][10]".
Das bedeutet, dass du ein 2D Array lokal anlegst, wenn die Funktion aufgerufen wird. Dh die map ist am Ende der Funktion wieder verloren. Dh du kannst nicht von einer anderen Funktion darauf zugreifen UND dh dass beim nächsten Aufruf von the_map map wieder genau den selben Zustand hat wie VOR dem ersten Aufruf. Man kann also immer nur genau eine Aktion durchführen und dann beginnt es wieder von vorne.
Du solltest für den Anfang "char map [10][10]" ganz nach oben unter die includes packen damit es global verfügbar ist.
Dann machst du zB wie vorgeschlagen eine Funktion "void initMap()" die auf map zugreift und die Werte für den Spielstart vorbereitet. initMap wird zu Beginn der main einmal aufgerufen.
 
Zuletzt bearbeitet:
Morgen allerseits!

Danke für die Betreuung kuddlmuddl :)

1)Ich benutze Sublime Text 2 (ohne Lizens zZ) und Compile über den integrierten Builder wo ich dann die main.c in dem Ordner manuell öffne.

2/3) Wird später umgesetzt! Danke sehr!

//Edit, nachdem ich mit meinen Eltern einkaufen war sind mir paar Ideen gekommen. Tja Real halt :P
Aktionen werde ich in eine Funktion packen und noch mehr mögliche Aktionen hinzufügen.
Es sollen mehrere Level/Ebenen da sein.

Mir schwebt die Idee vor,daraus ein kleines Programmiertagebuch eines totalen Noobs, mit dem Hauptaspekt was zu lernen. Ja, Nein?

//Edit 2
Eine Möglichkeit die printf Nachricht einen Moment lang aufrecht zu lassen bevor die loop wieder anfängt?
 
Zuletzt bearbeitet:
Ich benutze Sublime Text 2
Hier ist indent:
http://stackoverflow.com/questions/9495007/indenting-code-in-sublime-text-2

//Edit 2
Eine Möglichkeit die printf Nachricht einen Moment lang aufrecht zu lassen bevor die loop wieder anfängt?
http://stackoverflow.com/search?q=[c]+sleep

Was ich jetzt überhaupt erst sehe: Du printest ja auch map in der Funktion the_map.
Das solltest du unbedingt auch auslagern!
Dann könntest du zB nach jedem Key-Press und durchführen der Veränderung einen print auslösen (=die print-Funktion aufrufen).
 
Code:
#include <stdio.h>
#include <stdlib.h>
//Showig the number of turns
int turn=1;y
//initialisating the map
char map [10][10]={
	{'#','#','#','#','#','#','#','#','#','#'},
	{'#',' ',' ',' ',' ',' ',' ',' ',' ','#'},
	{'#',' ',' ',' ',' ',' ',' ',' ',' ','#'},
	{'#',' ',' ',' ',' ',' ',' ',' ',' ','#'},
	{'#',' ',' ',' ',' ',' ',' ',' ',' ','#'},
	{'#',' ',' ',' ',' ',' ',' ',' ',' ','#'},
	{'#',' ',' ',' ',' ',' ',' ',' ',' ','#'},
	{'#',' ',' ',' ',' ',' ',' ',' ',' ','#'},
	{'#',' ',' ',' ',' ',' ',' ',' ',' ','#'},
	{'#','#','#','#','#','#','#','#','#','#'}, };

//x an y show the position of the '@'
int x=4;
int y=4;
void map_initialisation(int x, int y){
map [x][y]= '@';
//printing the map
int a;
int b;
for(a=0;a<10;a++){
	for(b=0;b<10;b++){
		if(b<9){
			printf("%c",map[a][b]);
				}
		if(b==9){
			printf("%c\n",map[a][b]);
			}
		}
	}
}


int main(){
unsigned int life=6;
while(life!=0){
	if(life<0){
		break;
	}

system("cls");
map_initialisation(x, y);

	if(turn==1){
		printf("I hope you enjoy the game! :)\n\n");
		system("Pause");
		
	}

	else{
//declaring the actions you can perform, f.e moving
//now the '#' is a wall
char action=getchar();
switch(action){
	case 'a': 
	if(map[x][y-1]=='#'){
		printf("Don't tun against a wall");
		break;
	}
	else{
	y-=1;
	map[x][y+1]=' '; break;
	}
	case 'w': 
	if(map[x-1][y]=='#'){
		printf("Don't tun against a wall");
		break;
	}
	else{
	x-=1;
	map[x+1][y]=' '; break;
	}
	case 'd': 
	if(map[x][y+1]=='#'){
		printf("Don't tun against a wall");
		break;
	}
	else{
	y+=1;
	map[x][y-1]=' '; break;
	}
	case 's': 
	if(map[x+1][y]=='#'){
		printf("Don't tun against a wall");
		break;
	}
	else{
	x+=1;
	map[x-1][y]=' '; break;
	}
			}
	}
	turn++;	
}
printf("You have lost!\n");
system("pause");
return 0;
}

folgendes wurde geändert:
die map ist nun global
'#' fungiert als "Wand"

was verändert werden muss:
die switch-funktion muss verschönert werden


@knuddl.
@link nr1
ich hab das mit strg+b schon eingerichtet :) bei np++ auch nur mit strg+shift+c.
ich bevorzuge aber sublime text 2 schon wegen dem highlightning

@link nr2
ok, weil ich lese das
Code:
system("pause");
nicht genutzt werden soll. stimmt das?

@funktion
alo printf loop in eine eigene funktion lagern?
würde switch in eine funktion einbauen


'//edit
ich bin am überlegen die ganzen funktionen und das feld einfach woanders zu erstelln um ehr übersicht zu haben.

//vigintillionste Edit
sieht besser aus, aktionen sind nun in funktionen. Jedoch bekomme ich es nicht hin, weshalb auch immer den Stage counter zu erhöhen....
nicht wundern wenn das nur in einer funktion da ist.
Code:
#include <stdio.h>
#include <stdlib.h>
//Showig the number of turns and the stage you are in
int turn=0;
int stage=1;
//the map
char map [10][10]={
	{'#','#','#','#','#','#','#','#','#','#'},
	{'#',' ','#',' ',' ',' ',' ',' ',' ','#'},
	{'#',' ','#',' ',' ',' ','#',' ',' ','#'},
	{'#',' ','#',' ',' ',' ','#',' ',' ','#'},
	{'#',' ','#',' ','&',' ','#',' ',' ','#'},
	{'#',' ','#',' ',' ',' ','#',' ',' ','#'},
	{'#',' ','#','#','#','#','#',' ',' ','#'},
	{'#',' ',' ',' ',' ',' ',' ',' ',' ','#'},
	{'#',' ',' ',' ',' ',' ',' ',' ',' ','#'},
	{'#','#','#','#','#','#','#','#','#','#'}, };
//x an y show the position of the '@', the character you play
int x=1;
int y=1;

void map_initialisation(int x, int y){
map [x][y]= '@';
//printing the map
int a;
int b;
for(a=0;a<10;a++){
	for(b=0;b<10;b++){
		if(b<9){
			printf("%c",map[a][b]);
				}
		if(b==9){
			printf("%c\n",map[a][b]);
			}
		}
	}
}


void moveLEFT(){ 
	switch(map[x][y-1]){
		case '#': printf("Don't tun against the wall"); 
			break;
		case ' ': y-=1; 
			      map[x][y+1]=' ';
			break;
		case '&': printf("Do you want to enter the next stage?\nY/N?\n\n");
	       		  char nextStage=getchar();
					if(nextStage=='Y'||'y'){
						stage++;
			break;
		}
	}
}

void moveUP(){
	switch(map[x-1][y]){
		case '#': printf("Don't tun against the wall"); 
			break;
		case ' ': x-=1; 
			      map[x+1][y]=' ';
			break;
		case '&': printf("Do you want to enter the next stage?\nY/N?\n\n");
	       		  char nextStage=getchar();
					if(nextStage=='Y'){
						stage++;
			break;
		}
	}
}
	
void moveRIGH(){
	switch(map[x][y+1]){
		case '#': printf("Don't tun against the wall"); 
			break;
		case ' ': y+=1; 
			      map[x][y-1]=' ';
			break;
		case '&': printf("Do you want to enter the next stage?\nY/N?\n\n");
	       		  char nextStage=getchar();
					if(nextStage=='Y'){
						stage++;
			break;
		}
	}
}

void moveDOWN(){
	switch(map[x+1][y]){
		case '#': printf("Don't tun against the wall"); 
			break;
		case ' ': x+=1; 
			      map[x-1][y]=' ';
			break;
		case '&': printf("Do you want to enter the next stage?\nY/N?\n\n");
	       		  char nextStage=getchar();
					if(nextStage=='Y'){
						stage++;
			break;
		}
	}
}



int main(){
unsigned int life=100;
while(life!=0){
	if(life<0){
		break;
	}
	if(turn==0){
		printf("I hope you enjoy the game! :)\n\n");
		system("Pause");
	}
else{
//printing the map and claring the screen
	system("cls");
	printf("Stage %d     Turn%d\n",stage, turn);
	map_initialisation(x,y);
//declaring the actions you can perform, f.e moving
char action=getchar();
switch(action){
	case 'a':moveLEFT(); break;
	case 'w':moveUP();   break;
	case 'd':moveRIGH(); break;
	case 's':moveDOWN(); break;

	}
}
	turn++;	
}
printf("You have lost!\n");
system("pause");
return 0;
}
letzter edit bzw. post für heute#

//EDIT ++
Ich melde mich mal wieder. Ich habe etwas was ich nicht verstehe, wie ich es löse.
nämlich warum mir auf der zweiten Karte der Bewegbare Char nicht angezeigt wird.

desweiteren habe ich den Code für mich etwas übersichtlicher mit Kommentaren gemacht so dass auch die Helfer hier besser sehen können, wo sich was befindet und ich es auch auf der Minimap in Sublime Text 2 sehen kann :D

Code:
#include <stdio.h>
#include <stdlib.h>

//The declared variables
//Showig the number of turns and the stage you are in
int turn=0;
int stage=1;
unsigned int life=10;
//x an y show the position of the '@', the character you play
int x_Player=1;
int y_Player=1;
//x an y show the position of the 'E', the character you have to kill
int x_Enemie=8;
int y_Enemie=8;

//the map you are gonna go to discover
//Map NR1
char map [10][10]={
	{'#','#','#','#','#','#','#','#','#','#'},
	{'#',' ',' ',' ',' ',' ',' ',' ',' ','#'},
	{'#',' ',' ',' ',' ',' ','#',' ',' ','#'},
	{'#',' ',' ',' ',' ',' ','#',' ',' ','#'},
	{'#',' ','#',' ','&',' ','#',' ',' ','#'},
	{'#',' ','#',' ',' ',' ','#',' ',' ','#'},
	{'#',' ','#','#','#','#','#',' ',' ','#'},
	{'#',' ',' ',' ',' ',' ',' ',' ',' ','#'},
	{'#',' ',' ',' ',' ',' ',' ',' ',' ','#'},
	{'#','#','#','#','#','#','#','#','#','#'} };
//Map NR2
char map2 [10][10]={
	{'#','#','#','#','#','#','#','#','#','#'},
	{'#',' ',' ',' ',' ',' ',' ',' ',' ','#'},
	{'#',' ',' ',' ',' ',' ','#',' ',' ','#'},
	{'#',' ',' ',' ',' ',' ','#',' ',' ','#'},
	{'#',' ','&',' ',' ',' ','#',' ',' ','#'},
	{'#',' ','#',' ',' ',' ','#',' ',' ','#'},
	{'#',' ','#','#','#','#','#',' ',' ','#'},
	{'#',' ',' ',' ',' ',' ',' ',' ',' ','#'},
	{'#',' ',' ',' ',' ',' ',' ',' ',' ','#'},
	{'#','#','#','#','#','#','#','#','#','#'} };

void Enemie(int x_Enemie, int y_Enemie){
map [x_Enemie][y_Enemie]='E';
}

///**********This here shows you and the enemies on the map, this comment is only here to make a clear and visual seperation************///
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

void map_initialisation(int x_Player, int y_Player,int stage){
//printing the map, you and the only one eneme, for not feeling too alone ;)
map [x_Player][y_Player]= '@';
Enemie(x_Enemie,y_Enemie);

int a=0;
int b=0;
//deciding which map is gonna get displayed in form of a switch statement
switch(stage){
case 1:  for(a=0;a<10;a++){
			for(b=0;b<10;b++){
				if(b<9){
			printf("%c",map[a][b]);
				}
				if(b==9){
			printf("%c\n",map[a][b]);
			}
		}
	}break;

case 2:  for(a=0;a<10;a++){
			for(b=0;b<10;b++){
				if(b<9){
			printf("%c",map2[a][b]);
				}
				if(b==9){
			printf("%c\n",map2[a][b]);
			}
		}
	}break;
}
}
///********************These here are the movements this comment is only here to make a clear and visual seperation********************///
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void moveLEFT(){ 
	switch(map[x_Player][y_Player-1]){
		case '#': printf("Don't tun against the wall"); 
			break;
		case ' ': y_Player-=1; 
			      map[x_Player][y_Player+1]=' ';
			break;
		case '&': printf("Do you want to enter the next stage?\nY/N?\n\n");
	       		  char nextStage;
	       		  nextStage=getchar();
					if(nextStage=='Y'||'y'){
						stage++;
					}
			break;
	}
}

void moveUP(){
	switch(map[x_Player-1][y_Player]){
		case '#': printf("Don't tun against the wall"); 
			break;
		case ' ': x_Player-=1; 
			      map[x_Player+1][y_Player]=' ';
			break;
		case '&': printf("Do you want to enter the next stage?\nY/N?\n\n");
	       		  char nextStage;
	       		  nextStage=getchar();
					if(nextStage=='Y'||'y'){
						stage++;
					}
			break;
	}
}
	
void moveRIGH(){
	switch(map[x_Player][y_Player+1]){
		case '#': printf("Don't tun against the wall"); 
			break;
		case ' ': y_Player+=1; 
			      map[x_Player][y_Player-1]=' ';
			break;
		case '&': printf("Do you want to enter the next stage?\nY/N?\n\n");
	       		  char nextStage;
	       		  nextStage=getchar();
					if(nextStage=='Y'||'y'){
						stage++;
					}
			break;
	}
}

void moveDOWN(){
	switch(map[x_Player+1][y_Player]){
		case '#': printf("Don't tun against the wall"); 
			break;
		case ' ': x_Player+=1; 
			      map[x_Player-1][y_Player]=' ';
			break;
		case '&': printf("Do you want to enter the next stage?\nY/N?\n\n");
	       		  char nextStage;
	       		  nextStage=getchar();
					if(nextStage=='Y'||'y'){
						stage++;
					}
			break;
	}
}

///***************Here is the main function starting, this comment is only here to make a clear and visual seperation******************///
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int main(){
while(life!=0){
	if(life<0){
		break;
		}
	if(turn==0){
		printf("I hope you enjoy the game! :)\n\n");
		system("Pause");
	}
	else{
//printing the map and clearing the screen
	system("cls");
	printf("Stage %d     Turn%d\n",stage, turn);
	printf("Life\n");

map_initialisation(x_Player,y_Player,stage);

//depending on your input you can perform actions, f.e moving the char
char action=getchar();
switch(action){
	case 'a':moveLEFT(); break;
	case 'w':moveUP();   break;
	case 'd':moveRIGH(); break;
	case 's':moveDOWN(); break;

	}
}
	turn++;	
}
printf("You have lost!\n");
system("pause");
return 0;
}
 
Zuletzt bearbeitet: (Spoiler "funktionsfähig" gemacht :))
SparkMonkay schrieb:
ok, weil ich lese das
Code:
system("pause");
nicht genutzt werden soll. stimmt das?

Ist halt Windows-spezifisch, in deinem Fall ist aber eh egal... Du benutzt immerhin sowieso schon
Code:
system("cls");
was genauso wenig portabel ist.
 
Zurück
Oben