Adds newline for character literal
This commit is contained in:
parent
254d1ec410
commit
39b3a57422
|
@ -140,6 +140,23 @@ s[11] = '!'
|
|||
<tr>
|
||||
<td>
|
||||
```C
|
||||
char a = '\n';
|
||||
printf("byte %d\nA%cB\n", a, a);
|
||||
```
|
||||
</td>
|
||||
<td>
|
||||
```Nimrod
|
||||
let a = '\L'
|
||||
echo "byte ", $int(a), "\nA" & $a & "B"
|
||||
```
|
||||
</td>
|
||||
<td><b>Newlines and chars</b>. In nimrod you can't use ``\n`` as a character literal, because on the Windows platform it expands to CR+LR. So you need to specify which char to use.</i>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
```C
|
||||
9 % 8 // 1
|
||||
-9 % 8 // -1
|
||||
(unsigned)(-9) % (unsigned)(8) // 7
|
||||
|
|
Loading…
Reference in New Issue