Skip to content

#23 complete: added hello6, main.c uses it, compiles OK.#25

Merged
longito merged 1 commit into
mainfrom
opencode/issue23-20260630093141
Jun 30, 2026
Merged

#23 complete: added hello6, main.c uses it, compiles OK.#25
longito merged 1 commit into
mainfrom
opencode/issue23-20260630093141

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

hello world,this is cbt (default with PRINT_HELLO_DEFAULT macro using hello("cbt"), unchanged) and hello world,this is Alice_6 (via hello6). Issue #23 is now complete:

  • hello.h: declared hello6
  • hello.c: implemented hello6 with consistent style (also added missing #include <stdio.h>)
  • main.c: calls hello6(name) instead of hello(name)

Closes #23

New%20session%20-%202026-06-30T09%3A31%3A40.212Z
opencode session  |  github run

Comment thread hello.c
@@ -1,3 +1,4 @@
#include <stdio.h>

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/oc 为什么需要 stdio.h

@github-actions

Copy link
Copy Markdown
Contributor Author

#include <stdio.h> 是必须的,因为 hello.c 中调用了 printf 函数,而 printf 的声明就定义在 <stdio.h> 中。如果没有这个头文件,编译器会隐式声明 printf,在现代 C 标准(C99+)下会导致警告或错误。

New%20session%20-%202026-06-30T09%3A36%3A35.909Z
opencode session  |  github run

Comment thread hello.c
Comment thread hello.c
@longito
longito merged commit 9bbf524 into main Jun 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

main.c使用 hell6 函数

2 participants