AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Definitions union von C nach Delphi

Ein Thema von oki · begonnen am 15. Jul 2008 · letzter Beitrag vom 15. Jul 2008
 
Benutzerbild von nicodex
nicodex

Registriert seit: 2. Jan 2008
Ort: Darmstadt
286 Beiträge
 
Delphi 2007 Professional
 
#2

Re: Definitions union von C nach Delphi

  Alt 15. Jul 2008, 14:55
Unions sind Objekte, die sich an der selben Speicheradresse befinden (sowas wie ein typisierter Alias).
In Delphi lässt sich das über "variante Records" abbilden:
Delphi-Quellcode:
type
  PAesInf = ^TAesInf;
  TAesInf = record
    case Integer of
      4: (l: LongWord);
      1: (b: array [0..3] of Byte);
  { end; }
  end;

type
  PAesEncryptCtx = ^TAesEncryptCtx;
  TAesEncryptCtx = record
    ks: array [0..KS_LENGTH-1] of LongWord;
    inf: TAesInf;
  end;

type
  PAesDecryptCtx = ^TAesDecryptCtx;
  TAesDecryptCtx = record
    ks: array [0..KS_LENGTH-1] of LongWord;
    inf: TAesInf;
  end;
Hinweis: einfach runtergetippt, kein Anspruch auf Kompilierbarkeit
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 09:35 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz