Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F120628577
demo1.tex
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Jul 5, 18:02
Size
731 B
Mime Type
text/x-c
Expires
Mon, Jul 7, 18:02 (2 d)
Engine
blob
Format
Raw Data
Handle
27217143
Attached To
R232 fabrepos2
demo1.tex
View Options
\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
Event Timeline
Log In to Comment