3 回答

TA貢獻1829條經驗 獲得超4個贊
//建立文件 hello.h
#ifndef _ _HELLO_H_ _
#define _ _HELLO_H_ _
void Hello(void);
#endif
//建立文件 hello.cpp
#include<iostream>
using namespace std;
#include"hello.h"
void Hello(void)
{
cout<<"Hello,world!"<<end;
}
//建立文件 main.cpp
#include<stdlib.h>
#include"hello.h"
int main()
{
Hello();
system("PAUSE");
return 0;
}

TA貢獻1712條經驗 獲得超3個贊
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
printf("Hello World\n");
return 0;
}

TA貢獻1735條經驗 獲得超5個贊
#ifndef _ _HELLO_H_ _
#define _ _HELLO_H_ _
void Hello(void);
#endif
//這些 放在一個頭文件里 名字改為hello.h
//********************************************************************************************
#include<iostream>
using namespace std;
#include"hello.h"
void Hello(void)
{
cout<<"Hello,world!"<<end;
}
//這些放在一個cpp文件里 名字改為hello.cpp
//**************************************************************************************
#include<stdlib.h>
#include"hello.h"
int main()
{
Hello();
system("PAUSE");
return 0;
}
//這些放在一個cpp文件里 名字任意
- 3 回答
- 0 關注
- 145 瀏覽
添加回答
舉報