From 7a65bfaf26f37e00c01bafb18a592b1f01cea6c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20G=C3=B6r?= Date: Mon, 25 Dec 2023 16:54:33 +0300 Subject: [PATCH] foo example --- c-basic/foo.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 c-basic/foo.c diff --git a/c-basic/foo.c b/c-basic/foo.c new file mode 100644 index 0000000..254a67a --- /dev/null +++ b/c-basic/foo.c @@ -0,0 +1,22 @@ +#include + +int foo() +{ + printf("I am foo\n"); +} + +int main() +{ + foo(); +} + +/** + In the written book it is foo() and main() and it returns this warning + ~/Projects/hwpplayer1/c-course/c-basic $ gcc foo.c +foo.c:3:1: warning: return type defaults to ‘int’ [-Wimplicit-int] + 3 | foo() + | ^~~ +foo.c:8:1: warning: return type defaults to ‘int’ [-Wimplicit-int] + 8 | main() + | ^~~~ + **/