Sign in Join
Wiki copytemporary

Pascal for C users/de: what changed

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

OldNewLine
1-\
21Zurück zu den [[Additional information/de|Zusätzlichen Informationen]].\
3-\
2+
43=Übersetzen von C Operatoren=
54
65## Arithmetische Operatoren
76
87| C | Pascal | Kommentare |
98|------|--------|-----------------------------------|
109|   + |   + |   Addition |
1110|   - |   - |   Subtraktion |
1211|   * |   * |   Multiplikation |
1312|   / |   / |   Gleitkommadivision |
1413|   % |   Mod |   Modulo (Division ohne Rest) |
1514|   ++ |   Inc |   inkrementieren (Hochzählen) |
1615|   -- |   Dec |   dekrementieren (Herunterzählen) |
1716
1817## Relationale Operatoren
1918
2019| C | Pascal | |
2120|-------|--------|------------------|
2221|   == |   = |   gleich |
2322|   != |   \<\> |   ungleich |
2423|   \< |   \< |   kleiner |
2524|   \<= |   \<= |   kleiner gleich |
2625|   \> |   \> |   grösser |
2726|   \>= |   \>= |   grösser gleich |
2827
2928## Logische Operatoren
3029
31-<table>
3230<thead>
33-<tr>
34-<th>C</th>
35-<th>Pascal</th>
36-<th>Kommentare</th>
37-</tr>
31+
3832</thead>
3933<tbody>
40-<tr>
41-<td>  !</td>
42-<td>  Not</td>
43-<td>  Negation (Den Wahrheitswert in sein Gegenteil ändern)</td>
44-</tr>
45-<tr>
46-<td>  &amp;&amp;</td>
47-<td>  And</td>
48-<td>  logisches UND mit Kurzschlussauswertung<br />
34+
4935  In Free Pascal ist dies die Standard-Compilereinstellung</td>
50-</tr>
51-<tr>
52-<td>  &lt;nowiki&gt;</td>
53-<td></td>
54-<td>  Or</td>
55-</tr>
56-<tr>
57-<td>  &amp;</td>
58-<td>  And</td>
59-<td>  logisches UND mit Komplettauswertung<br />
36+
6037  In Free Pascal ist dies die Compilerdirektive {$B ON}</td>
61-</tr>
62-<tr>
63-<td>  |</td>
64-<td>  Or</td>
65-<td>  logisches ODER mit Komplettauswertung   In Free Pascal ist dies die Compilerdirektive {$B ON}</td>
66-</tr>
67-<tr>
68-<td>  ^</td>
69-<td>  Xor</td>
70-<td>  exclusives ODER</td>
71-</tr>
38+
7239</tbody>
73-</table>
7440
7541## Bit Operatoren
7642
7743| C | Pascal | Kommentare |
7844|--------|--------|-------------------------------------------|
7945|   ~ |   Not |   Einerkomplement |
8046|   & |   And |   bitweises UND |
8147|   \| |   Or |   bitweises inclusives ODER |
8248|   ^ |   Xor |   bitweises exclusives ODER |
8349|   \>\> |   Shr |   bitweises Rechtsschieben mit Vorzeichen |
8450|   \<\< |   Shl |   bitweises Linksschieben |
8551
8652## Zuweisungs Operatoren
8753
8854Hinweis:\
8955C-artige Operatoren werden in Free Pascal über die Kommandozeilenoption -Sc ermöglicht. C-artige Operatoren werden in Lazarus über die Projekteinstellungen ermöglicht.\
9056{\| 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 \|}
9157
9258## Sonstige Operatoren
9359
9460| C | Pascal | |
9561|------|--------|-------------------|
9662|   & |   @ |   Adresse von ... |
9763|   * |   ^ |   Zeiger |
9864
9965# Übersetzen von C Anweisungsblöcken
10066
10167| C | Pascal | Kommentare |
10268|-----|---------|-------------------------------------------|
10369|   { |   Begin |   Anfang eines Anweisungsblocks |
10470|   } |   End |   Ende / Abschluss eines Anweisungsblocks |
10571
10672# Übersetzen von C Kommentarzeichen
10773
10874| C | Pascal | Kommentare |
10975|-------|--------|---------------------------|
11076|   /* |   { |   Anfang eines Kommentars |
11177|   /* |   (* |   Anfang eines Kommentars |
11278|   */ |   } |   Ende eines Kommentars |
11379|   */ |   *) |   Ende eines Kommentars |
11480|   // |   // |   Kommentarzeile |
11581
11682# Übersetzen von C Schleifentypen
11783
11884| C | Pascal | Kommentare |
11985|----|----|----|
12086|   for( ...; ...; ...++) |   For ... To ... Do |   Kopfgesteuerte Schleife, die hochgezählt wird |
12187|   for(...; ...; ...--) |   For ... Downto ... Do |   Kopfgesteuerte Schleife, die heruntergezählt wird |
12288|   while (...) |   While ... Do |   Kopfgesteuerte Schleife |
12389|   do ... while(...) |   Repeat ... Until |   Fussgesteuerte Schleife |
12490|   do ... while!(...) |   Repeat ... Until ... Not |   Fussgesteuerte Schleife mit Negation des Ergebnisses des Ausdrucks |
12591
12692# Übersetzen von C Verzweigungen / Bedingungen
12793
12894| C | Pascal | Kommentare |
12995|----|----|----|
13096|   if(...) |   If ... Then |   If-Bedingung |
13197|   if(...) ... else |   If ... Then ... Else |   If-Bedingung mit Sonstzweig |
13298|   switch(...) case ...: ... break; |   Case ... Of ...: ... End |   Case-Bedingung |
13399|   switch(...) case ...: ... break; default ...; |   Case ... Of ...: ... Else ... End |   Case-Bedingung mit Sonst-Zweig |
134100
135101# Übersetzen von C Verzweigungen- / Schleifenabbrüchen
136102
137103| C | Pascal | Kommentare |
138104|----|----|----|
139105|   break |   Break |   Die break-Anweisung ermöglicht es, vorzeitig eine Schleife (oder ein switch-case-Konstrukt) zu verlassen |
140106|   continue |   Continue |   Die continue-Anweisung ermöglicht es, den aktuellen Schleifendurchlauf zu beenden |
141107
142108# Übersetzen von C Datentypen
143109
144110| C Datentyp | Pascal Datentyp | Speichergrösse in Bits | Range |
145111|----|----|----|----|
146112|   char |   Char |   8-bit |   Ein einzelnes Zeichen |
147113|   signed char |   Shortint |   8-bit |   -128 .. 127 |
148114|   unsigned char |   Byte |   8-bit |   0 .. 255 |
149115|   char* |   PChar |   32-bit |   Zeiger auf ein Chararray |
150116|   char16_t |   WideChar |   16-bit |   Verwendet für die Darstellung eines Zeichens zwei Byte Speicher (UTF16) |
151117|   char32_t |   WideChar |   32-bit |   Verwendet für die Darstellung eines Zeichens vier Byte Speicher (UTF32) |
152118|   short int |   SmallInt |   16-bit |   -32768 .. 32767 |
153119|   unsigned short int |   Word |   16-bit |   0 .. 65535 |
154120|   int |   Integer |   16-bit oder 32-bit |   -32.768 .. 32.767 bzw. -2147483648 .. 2147483647 |
155121|   unsigned int |   Cardinal |   16-bit oder 32-bit |   0 .. 65.535 bzw. 0 .. 4294967295 |
156122|   long int |   LongInt |   32-bit |   -2147483648 .. 2147483647 |
157123|   unsigned long int |   LongWord |   32-bit |   0 .. 4294967295 |
158124|   float |   Single |   32-bit |   1.5E-45 .. 3.4E+38 |
159125|   double |   Double |   64-bit |   5.0E-324 .. 1.7E+308 |
160126
161127# Übersetzen von C Strukturen
162128
163129| C | Pascal | |
164130|--------------|------------------|---------------------------|
165131|   struct { } |   Record End |   Strukturierter Datentyp |
166132|   union { } |   Record Case Of |   Variant Record |
167133
168134# Übersetzen von Sonstigem
169135
170136| C | Pascal | Unit |
171137|-----------|--------------|------------|
172138|   abs |   Abs |   System |
173139|   acos |   ArcCos |   Math |
174140|   asin |   ArcSin |   Math |
175141|   atan |   ArcTan |   System |
176142|   atof |   StrToFloat |   SysUtils |
177143|   atoi |   StrToInt |   SysUtils |
178144|   atol |   StrToInt |   SysUtils |
179145|   atoll |   StrToInt64 |   SysUtils |
180146|   ceil |   Ceil |   Math |
181147|   cos |   Cos |   System |
182148|   exp |   Exp |   System |
183149|   floor |   Floor |   Math |
184150|   pow |   Power |   Math |
185151|   round |   Round |   System |
186152|   sin |   Sin |   System |
187153|   sqrt |   Sqrt |   System |
188154|   strcpy |   Copy |   System |
189155|   strlen |   Length |   System |
190156|   tan |   Tan |   Math |
191157|   toupper |   UpCase |   System |
192158
193-\
194-\
195159--Olaf 15:29, 9 May 2013 (UTC)
196160
197161---
198162*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).*
199163Category: Code/de
200164Category: Deutsch

Back to history