Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!
Werbeanzeige
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 |
#include <iostream.h> #include <conio.h> using namespace std; void main(void) { void textcolor(int newcolor); textcolor (5); cout << "Hallo" << endl; getch (); } |
Administrator
Zitat von »"Lord-archimedes"«
Was hab ich Falsch gemacht ??
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
#include <windows.h> #include <iostream.h> #include <conio.h> using namespace std; void textcolor(int newcolor) { textcolor (5); } int main() { void textcolor (); cout << "Hallo" << endl; getch (); } |
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
#include <windows.h> #include <iostream.h> #include <conio.h> using namespace std; void textcolor(int newcolor) { textcolor (5); } int main() { textcolor (); cout << "Hallo" << endl; getch (); } |
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
#include <windows.h> #include <iostream.h> #include <conio.h> using namespace std; void textcolor(int newcolor) { textcolor (5); // rekursiver aufruf :-) } int main() { void textcolor (); // void weg und parameter fehlt cout << "Hallo" << endl; getch (); } |
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
#include <iostream> #include <conio.h> void textcolor() { ::textcolor( 5 ); } int main() { textcolor(); std::cout << "Hallo" << std::endl; getch(); } |
Quellcode |
|
1 |
Wenn textcolor aufgerufen wurde, verwenden alle folgenden Aufrufe von Funktionen mit direkter Bildschirmausgabe (wie z.B. cprintf) den Parameter newcolor. |
Werbeanzeige