C++菜鸟就能解决的问题

来源:百度知道 编辑:UC知道 时间:2024/05/16 14:02:43
在VC++6.0下,帮我建一个库,写下流程,越详细越好。好的我加分。
/****************************************/
这里是库文件:
#include <Heat.h>
double fahrToCelsius(double tempFahr)
{
return (tempFahr-32.0)/1.8;
}
double celsiusToFahr(double tempCels)
{
return tempCels*1.8+32.0;
}
/**********************/
怎样才可以把他放到下面的调用?

********
#include <iostream>
using namespace std;
#include "Heat.h"

int main()
{
cout <<"This program converts a temperature\n"
"form Fahrenheit to Celsius.\n";

cout "\nEnter a Fahrenheit temperature:";
double tempFahernheit;
cin >>tempFahrenheit;
double tempCelsius =fahrToCelsius(tempFahrenheit);

cout <<tempFahrenheit <<endl <<tempCelsius <<endl;
}
/******************/
写下创建库的流程好吗?谢谢各位大虾。
to==>logo0775:没有文字说明我看不懂啊。

呵呵.那我慢慢打吧.

按下ctrl+n===>project===>win32 console application
===>在右边输入project name(工程名:)
在右边的location选择保存路径:
选择"create new workspace ",在"win32"前打个勾
点击"OK".然后选择"an empty project".然后"finish"点击即可

第二步:
按下ctrl+N,选择+++>files+++>点击"c/c++ source file"
在右边"add to project"打个勾,在"FIle"写上文件名字例如(main)可以随便取名>然后点击"OK'
然后把
#include <iostream>
using namespace std;
#include "Heat.h"

int main()
{
cout <<"This program converts a temperature\n"
"form Fahrenheit to Celsius.\n";

cout "\nEnter a Fahrenheit temperature:";
double tempFahernheit;
cin >>tempFahrenheit;
double tempCelsius =fahrToCelsius(tempFahrenheit);

cout <<tempFahrenheit <<endl <<tempCelsius <<endl;