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#-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
[StructLayout(LayoutKind.Explicit)] public struct Parser_Argument_t { [FieldOffset(0)] public Parser_ArgumentType_t type; [FieldOffset(4)] public int int_value; [FieldOffset(4)] public float float_value; [FieldOffset(4)] public byte char_value; [FieldOffset(4)] public string string_value; } |
Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »AlymcGeel« (25.05.2011, 09:43)
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 |
typedef struct { /** Type of the argument. */ Parser_ArgumentType_t type; //das is nur ein enum /** Used to contain the value of the argument. */ union { int32_t int_value; // is ein int float float_value; int8_t char_value; //is ein char char_t* string_value; } value; } Parser_Argument_t; |
C#-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
[StructLayout(LayoutKind.Explicit)] public struct Parser_Argument_t { [FieldOffset(0)] public Parser_ArgumentType_t type; [FieldOffset(4)] public int int_value; [FieldOffset(4)] public float float_value; [FieldOffset(4)] public byte char_value; [FieldOffset(8)] // oder eben 4, weil 8 falsch is [MarshalAs(UnmanagedType.LPStr)] public string string_value; } |
C-/C++-Quelltext |
|
1 2 3 4 5 |
Parser_Status_t Parser_Parse( const char_t* const inputFile, size_t* const statementCnt, Parser_Statement_t** const statementList) { yyin = fopen(inputFile, "r"); |
Dieser Beitrag wurde bereits 3 mal editiert, zuletzt von »AlymcGeel« (25.05.2011, 14:11)
Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »AlymcGeel« (26.05.2011, 08:27)
Ich hab grad mit den zuständigen Leuten gesprochen und sie machen da nen bugfix.
Werbeanzeige