2022-12-30 16:29:57 +00:00
|
|
|
|
NEW
|
|
|
|
|
AUTO 3,1
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
2023-01-21 21:53:55 +00:00
|
|
|
|
/* C-style comments....
|
|
|
|
|
...multi-lines */
|
|
|
|
|
|
2023-01-23 18:33:37 +00:00
|
|
|
|
#ifndef _TESTDEF_
|
|
|
|
|
|
|
|
|
|
int testdef;
|
|
|
|
|
#define _TESTDEF_ 1
|
|
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
|
|
int testdef2;
|
|
|
|
|
#endif
|
|
|
|
|
|
2022-12-30 16:29:57 +00:00
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
|
{
|
|
|
|
|
puts("Press a key");
|
|
|
|
|
char c=getchar();
|
|
|
|
|
printf("char=%d\r\n", c);
|
|
|
|
|
if (c == 13)
|
|
|
|
|
{
|
|
|
|
|
puts("ENTER");
|
2023-01-21 21:53:55 +00:00
|
|
|
|
// C99 comments: skip LF
|
|
|
|
|
getchar();
|
2022-12-30 16:29:57 +00:00
|
|
|
|
}
|
2023-01-21 21:53:55 +00:00
|
|
|
|
else
|
|
|
|
|
if (c == 32)
|
|
|
|
|
{
|
|
|
|
|
puts("Not ENTER...but SPACE");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
puts("Some other key...");
|
2022-12-30 16:29:57 +00:00
|
|
|
|
|
|
|
|
|
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
|