A2osX/ROOT/ctest/testargs.c.txt

59 lines
1.1 KiB
Plaintext
Raw Normal View History

NEW
AUTO 3,1
#include <stdio.h>
int testf1() {
puts("testf1 called!");
int r = 1029;
if (r == 1029) {
printf("testf1 will return %D...\r\n", r);
}
return r;
}
int testf2() {
puts("testf2 called!");
return 1000;
}
void testf3(char *msg)
{
puts(msg);
}
int testf4(int arg1, int arg2) {
printf("arg1=%D, arg2=%D\r\n", arg1, arg2);
return arg1 + arg2;
}
int i;
// unreachable code
printf("i=%D\r\n", i);
int main(int argc, char *argv[]) {
int r=testf1();
printf("testf1() returned %D\r\n", r);
getchar();
r=testf2();
printf("testf2() returned %D\r\n", r);
getchar();
testf3("testf3() void function...");
getchar();
i = testf4(34, 43);
printf("testf4() returned %D\r\n", i);
printf("main() argc=%D\r\n", argc);
getchar();
for(int i=0; i<=argc; i++) printf(" argv[%D]=%s\r\n", i, argv[i]);
printf("i = %D\r\n", i);
puts("set main() return code=0x73");
return 115; // return E_INUM
}
MAN
TEXT root/ctest/testargs.c