From f87ad41f72ca4465a0c5b4ba9fd36a7b09e4d4f4 Mon Sep 17 00:00:00 2001 From: Alberto Sartori Date: Mon, 24 Jun 2024 15:49:36 +0200 Subject: Initial commit Co-authored-by: Klaus Aehlig --- test/rust-from-c/main.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 test/rust-from-c/main.c (limited to 'test/rust-from-c/main.c') diff --git a/test/rust-from-c/main.c b/test/rust-from-c/main.c new file mode 100644 index 0000000..0f69281 --- /dev/null +++ b/test/rust-from-c/main.c @@ -0,0 +1,14 @@ +#include +#include + +int foo(int); + +int main(int argc, char **argv) { + if (argc < 2) { + fprintf(stderr, "Please provide one number as argument\n"); + exit(1); + } + int x = atoi(argv[1]); + printf("absolute value of %d is %d\n", x, foo(x)); + return 0; +} -- cgit v1.2.3