diff options
author | Karl Berry <karl@freefriends.org> | 2006-01-09 00:56:57 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-01-09 00:56:57 +0000 |
commit | f07bb53970ee2ecc53f81a206a3d3a67ef665e4a (patch) | |
tree | 6f57a1d62971db79e5ff023bdfd83b22cb971dc9 /Master/texmf-dist/doc/generic/c-pascal/demo1.tex | |
parent | 007f67a693e4d031fd3d792df8e4d5f43e2cb2e7 (diff) |
doc 6
git-svn-id: svn://tug.org/texlive/trunk@85 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/generic/c-pascal/demo1.tex')
-rw-r--r-- | Master/texmf-dist/doc/generic/c-pascal/demo1.tex | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/generic/c-pascal/demo1.tex b/Master/texmf-dist/doc/generic/c-pascal/demo1.tex new file mode 100644 index 00000000000..76d349b1de2 --- /dev/null +++ b/Master/texmf-dist/doc/generic/c-pascal/demo1.tex @@ -0,0 +1,42 @@ +\input cap_c +\magnification 1440 + + +\BeginC +// this is a short demo program +/* both kinds of comment are recognised */ + +// some compiler directives +#pragma hdrfile "hello.sym" +#include <stdio.h> +#include <sys/stat.h> +#pragma hdrstop + +void hello(int n) +{ + // obviously, keywords inside comments or + // texts are not emphasized: + // void return switch for double + for (; n>0; n--) + printf("Hello, void world!\n"); + /* ^ isn't that beautiful? */ +} + +float silly_funct() +{ + #define max(a,b) ((a)>(b))?(a):(b) + printf("%7.4lf\n", max(3.14, 012)); +} + +// words not recognised as keywords are considered +// to be identifiers and are typeset in italic +void main() +{ + int n; + hello(0x1C); + silly_funct(); +} +\EndC + + +\bye |