Last active
August 31, 2015 03:45
-
-
Save danielmai/d92073c240ad70737230 to your computer and use it in GitHub Desktop.
Testing NUL character output from Pascal.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Program NoNulChar; | |
TYPE | |
Buffer = PACKED ARRAY[0..200] of char; | |
VAR | |
B : Buffer; | |
BEGIN | |
readln(B); | |
writeln(B); | |
END. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[vagrant debian]:assignment1$ echo 'text' | ./no_nul_char | od -a | |
0000000 t e x t nl | |
0000005 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Program NulChar; | |
TYPE | |
Buffer = PACKED ARRAY[0..200] of char; | |
VAR | |
B : Buffer; | |
I : integer; | |
BEGIN | |
readln(B); | |
FOR I := 0 to 200 DO | |
write(B[I]); | |
END. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[vagrant debian]:assignment1$ echo 'text' | ./nul_char | od -a | |
0000000 t e x t nul nul nul nul nul nul nul nul nul nul nul nul | |
0000020 nul nul nul nul nul nul nul nul nul nul nul nul nul nul nul nul | |
* | |
0000300 nul nul nul nul nul nul nul nul nul | |
0000311 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment