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
Quellcode |
|
1 2 3 4 |
typedef int integer; int a = 3; integer b = 3; |
Quellcode |
|
1 2 3 |
map< string, string > StringMap; map< string, string >::iterator it = StringMap.begin(); |
Quellcode |
|
1 2 3 |
typdef map< string, string >::iterator StringMapIterator; StringMapIterator it = StringMap.begin(); |
C-/C++-Quelltext |
|
1 2 3 4 5 6 |
typedef struct Point{int x, int y}; Punkt; ... Punkt p1; Point p2; |
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 |
struct Point{int x, int y}; typedef Point Punkt; ... Punkt p1; Point p2; ] |
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
// Simples Beispiel: void Use(int line, bool realy) { if(realy) cout << line; } // Anstatt: void (*pFunc)(int, bool) = &Use; // macht man: typedef void (*FuncType)(int, bool); FuncType pFunc = &Use; |
Zitat von »"C--"«
Noch ne Frage, geht dann auch sowas:
C-/C++-Quelltext |
|
1 |
typedef struct Point{int x, int y} Punkt; |
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
struct Point { int x; int y; }; // ... struct Point p1; // <-- "struct" muss da hin struct Point p2; p1.x; p2.y; // ... void blub(struct Point *p) // <-- "struct" muss da hin { p->x = 0; } |
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
struct Point_ { int x; int y; }; typedef struct Point_ Point; // ... struct Point_ p1; Point p2; // jetzt gehts wie in C++ auch p1.x; p2.y; // ... void blub(Point *p) { p->x = 0; } |
C-/C++-Quelltext |
|
1 2 3 4 5 |
typedef struct { int x; int y; } Point; |
C-/C++-Quelltext |
|
1 |
typedef struct Point {int x; int y;}Punkt; |
Zitat von »"Jonathan_Klein"«
Probiers doch einfach aus (kompilieren)
Werbeanzeige