Küñ*_*örà 0 c header-files forward-declaration
如何在不使用C中的头文件的情况下编写hello world?
#include<conio.h>
#include<stdio.h>
void main(){
printf("Hello World");
getch();
}
Run Code Online (Sandbox Code Playgroud)
这是带头文件的简单C程序......
conio.h - 用于控制台stdio.h- 用于printf和scanf您需要头文件主要是因为库函数的原型声明加上任何必要的类型和便于其使用所需的其他宏.它们以头文件的形式提供,以便于重复使用.
在你的情况下,你可以自己编写原型,你应该没事
/* Prototypes on your own */
int getchar(void);
int printf(const char *format, ...);
int puts(const char *s);
int main(void) { //this is the prescribed signature for hosted environment
//printf("Hello World\n"); //not good to use printf if don;t need conversion
puts("Hello World");
//getchar();
return 0;
}
Run Code Online (Sandbox Code Playgroud)
应该做得很好.