Sign in Join
Wiki copytemporary

Pascal for C users/de: what changed

Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11Zurück zu den [[Additional information/de|Zusätzlichen Informationen]].\
22
33=Übersetzen von C Operatoren=
44
55## Arithmetische Operatoren
66
77| C | Pascal | Kommentare |
88|------|--------|-----------------------------------|
99|   + |   + |   Addition |
1010|   - |   - |   Subtraktion |
1111|   * |   * |   Multiplikation |
1212|   / |   / |   Gleitkommadivision |
1313|   % |   Mod |   Modulo (Division ohne Rest) |
1414|   ++ |   Inc |   inkrementieren (Hochzählen) |
1515|   -- |   Dec |   dekrementieren (Herunterzählen) |
1616
1717## Relationale Operatoren
1818
1919| C | Pascal | |
2020|-------|--------|------------------|
2121|   == |   = |   gleich |
2222|   != |   \<\> |   ungleich |
2323|   \< |   \< |   kleiner |
2424|   \<= |   \<= |   kleiner gleich |
2525|   \> |   \> |   grösser |
2626|   \>= |   \>= |   grösser gleich |
2727
2828## Logische Operatoren
2929
30-<thead>
31-
32-</thead>
33-<tbody>
34-
35-  In Free Pascal ist dies die Standard-Compilereinstellung</td>
36-
37-  In Free Pascal ist dies die Compilerdirektive {$B ON}</td>
38-
39-</tbody>
30+| C | Pascal | Kommentare |
31+|---|---|---|
32+| ! | Not | Negation (Den Wahrheitswert in sein Gegenteil ändern) |
33+| && | And | logisches UND mit Kurzschlussauswertung · In Free Pascal ist dies die Standard-Compilereinstellung |
34+| <nowiki> | | Or |
35+| & | And | logisches UND mit Komplettauswertung · In Free Pascal ist dies die Compilerdirektive {$B ON} |
36+| \| | Or | logisches ODER mit Komplettauswertung In Free Pascal ist dies die Compilerdirektive {$B ON} |
37+| ^ | Xor | exclusives ODER |
4038
4139## Bit Operatoren
4240
4341| C | Pascal | Kommentare |
4442|--------|--------|-------------------------------------------|
4543|   ~ |   Not |   Einerkomplement |
4644|   & |   And |   bitweises UND |
4745|   \| |   Or |   bitweises inclusives ODER |
4846|   ^ |   Xor |   bitweises exclusives ODER |
4947|   \>\> |   Shr |   bitweises Rechtsschieben mit Vorzeichen |
5048|   \<\< |   Shl |   bitweises Linksschieben |
5149
5250## Zuweisungs Operatoren
5351
5452Hinweis:\
5553C-artige Operatoren werden in Free Pascal über die Kommandozeilenoption -Sc ermöglicht. C-artige Operatoren werden in Lazarus über die Projekteinstellungen ermöglicht.\
5654{\| class="wikitable" ! C !! Pascal !! Kommentare \|- \|   = \|   := \|   Einfache Zuweisung \|- \|   += \|   += \|   Additionszuweisung \|- \|   -= \|   -= \|   Subtraktionszuweisung \|- \|   *= \|   *= \|   Multiplikationszuweisung \|- \|   /= \|   /= \|   Divisionszuweisung \|- \|   %= \|   ist in Free Pascal nicht vorhanden \|   Modulo Zuweisung \|- \|   &= \|   ist in Free Pascal nicht vorhanden \|   UND Zuweisung \|- \|   \|= \|   ist in Free Pascal nicht vorhanden \|   ODER Zuweisung \|- \|   ^= \|   ist in Free Pascal nicht vorhanden \|   Exclusive ODER Zuweisung \|- \|   \>\>= \|   ist in Free Pascal nicht vorhanden \|   Rechtsschiebe Zuweisung \|- \|   \<\<= \|   ist in Free Pascal nicht vorhanden \|   Linksschiebe Zuweisung \|}
5755
5856## Sonstige Operatoren
5957
6058| C | Pascal | |
6159|------|--------|-------------------|
6260|   & |   @ |   Adresse von ... |
6361|   * |   ^ |   Zeiger |
6462
6563# Übersetzen von C Anweisungsblöcken
6664
6765| C | Pascal | Kommentare |
6866|-----|---------|-------------------------------------------|
6967|   { |   Begin |   Anfang eines Anweisungsblocks |
7068|   } |   End |   Ende / Abschluss eines Anweisungsblocks |
7169
7270# Übersetzen von C Kommentarzeichen
7371
7472| C | Pascal | Kommentare |
7573|-------|--------|---------------------------|
7674|   /* |   { |   Anfang eines Kommentars |
7775|   /* |   (* |   Anfang eines Kommentars |
7876|   */ |   } |   Ende eines Kommentars |
7977|   */ |   *) |   Ende eines Kommentars |
8078|   // |   // |   Kommentarzeile |
8179
8280# Übersetzen von C Schleifentypen
8381
8482| C | Pascal | Kommentare |
8583|----|----|----|
8684|   for( ...; ...; ...++) |   For ... To ... Do |   Kopfgesteuerte Schleife, die hochgezählt wird |
8785|   for(...; ...; ...--) |   For ... Downto ... Do |   Kopfgesteuerte Schleife, die heruntergezählt wird |
8886|   while (...) |   While ... Do |   Kopfgesteuerte Schleife |
8987|   do ... while(...) |   Repeat ... Until |   Fussgesteuerte Schleife |
9088|   do ... while!(...) |   Repeat ... Until ... Not |   Fussgesteuerte Schleife mit Negation des Ergebnisses des Ausdrucks |
9189
9290# Übersetzen von C Verzweigungen / Bedingungen
9391
9492| C | Pascal | Kommentare |
9593|----|----|----|
9694|   if(...) |   If ... Then |   If-Bedingung |
9795|   if(...) ... else |   If ... Then ... Else |   If-Bedingung mit Sonstzweig |
9896|   switch(...) case ...: ... break; |   Case ... Of ...: ... End |   Case-Bedingung |
9997|   switch(...) case ...: ... break; default ...; |   Case ... Of ...: ... Else ... End |   Case-Bedingung mit Sonst-Zweig |
10098
10199# Übersetzen von C Verzweigungen- / Schleifenabbrüchen
102100
103101| C | Pascal | Kommentare |
104102|----|----|----|
105103|   break |   Break |   Die break-Anweisung ermöglicht es, vorzeitig eine Schleife (oder ein switch-case-Konstrukt) zu verlassen |
106104|   continue |   Continue |   Die continue-Anweisung ermöglicht es, den aktuellen Schleifendurchlauf zu beenden |
107105
108106# Übersetzen von C Datentypen
109107
110108| C Datentyp | Pascal Datentyp | Speichergrösse in Bits | Range |
111109|----|----|----|----|
112110|   char |   Char |   8-bit |   Ein einzelnes Zeichen |
113111|   signed char |   Shortint |   8-bit |   -128 .. 127 |
114112|   unsigned char |   Byte |   8-bit |   0 .. 255 |
115113|   char* |   PChar |   32-bit |   Zeiger auf ein Chararray |
116114|   char16_t |   WideChar |   16-bit |   Verwendet für die Darstellung eines Zeichens zwei Byte Speicher (UTF16) |
117115|   char32_t |   WideChar |   32-bit |   Verwendet für die Darstellung eines Zeichens vier Byte Speicher (UTF32) |
118116|   short int |   SmallInt |   16-bit |   -32768 .. 32767 |
119117|   unsigned short int |   Word |   16-bit |   0 .. 65535 |
120118|   int |   Integer |   16-bit oder 32-bit |   -32.768 .. 32.767 bzw. -2147483648 .. 2147483647 |
121119|   unsigned int |   Cardinal |   16-bit oder 32-bit |   0 .. 65.535 bzw. 0 .. 4294967295 |
122120|   long int |   LongInt |   32-bit |   -2147483648 .. 2147483647 |
123121|   unsigned long int |   LongWord |   32-bit |   0 .. 4294967295 |
124122|   float |   Single |   32-bit |   1.5E-45 .. 3.4E+38 |
125123|   double |   Double |   64-bit |   5.0E-324 .. 1.7E+308 |
126124
127125# Übersetzen von C Strukturen
128126
129127| C | Pascal | |
130128|--------------|------------------|---------------------------|
131129|   struct { } |   Record End |   Strukturierter Datentyp |
132130|   union { } |   Record Case Of |   Variant Record |
133131
134132# Übersetzen von Sonstigem
135133
136134| C | Pascal | Unit |
137135|-----------|--------------|------------|
138136|   abs |   Abs |   System |
139137|   acos |   ArcCos |   Math |
140138|   asin |   ArcSin |   Math |
141139|   atan |   ArcTan |   System |
142140|   atof |   StrToFloat |   SysUtils |
143141|   atoi |   StrToInt |   SysUtils |
144142|   atol |   StrToInt |   SysUtils |
145143|   atoll |   StrToInt64 |   SysUtils |
146144|   ceil |   Ceil |   Math |
147145|   cos |   Cos |   System |
148146|   exp |   Exp |   System |
149147|   floor |   Floor |   Math |
150148|   pow |   Power |   Math |
151149|   round |   Round |   System |
152150|   sin |   Sin |   System |
153151|   sqrt |   Sqrt |   System |
154152|   strcpy |   Copy |   System |
155153|   strlen |   Length |   System |
156154|   tan |   Tan |   Math |
157155|   toupper |   UpCase |   System |
158156
159157--Olaf 15:29, 9 May 2013 (UTC)
160158
161159---
162160*From the Free Pascal wiki, page "Pascal for C users/de", as it stood on 2014-01-12 after a change by Olaf, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
163161Category: Code/de
164162Category: Deutsch

Back to history