A2osX/ROOT/ctest/testif.c.txt

48 lines
753 B
Plaintext
Raw Permalink Normal View History

NEW
AUTO 3,1
#include <stdio.h>
/* C-style comments....
...multi-lines */
2023-01-23 18:33:37 +00:00
#ifndef _TESTDEF_
int testdef;
#define _TESTDEF_ 1
#else
int testdef2;
#endif
int main(int argc, char *argv[])
{
puts("Press a key");
char c=getchar();
printf("char=%d\r\n", c);
if (c == 13)
{
puts("ENTER");
// C99 comments: skip LF
getchar();
}
else
if (c == 32)
{
puts("Not ENTER...but SPACE");
}
else
puts("Some other key...");
int i=0;
while (i++ < 10) {
if (i==5) continue;
printf("count1=%I\r\n", i);
}
do {
printf("count2=%I\r\n", i);
} while (i-- > 0);
}
MAN
TEXT root/ctest/testif.c