# 在 C 语言中,void 是什么意思
Issue
欢迎在 Gtihub Issue 中回答此问题: Issue 440 (opens new window)
Author
void
,空的意思,意即无需返回。
#include <stdio.h>
void print() {
puts("hello, world");
return;
}
int main() {
print();
return 0;
}
代码如上所示: return
没有返回任何东西,为其简便可以省略不写,以下两者是等价的
void print() {
puts("hello, world");
return;
}
void print() {
puts("hello, world");
}
Author
表示为空,跟 ts 一样的。