A2osX/ROOT/ctest/testargs.c.txt
2023-01-06 15:02:35 +01:00

59 lines
1.1 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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);
getchar();
printf("main() argc=%D\r\n", argc);
for(int i=0; i<=argc; i++) {
printf(" argv[%I] : %s\r\n", i, argv[i]);
}
puts("set main() return code=0x73");
return 115; // return E_INUM
}
MAN
TEXT root/ctest/testargs.c