懂C++的大俠幫看看, 謝謝

我怎麽才可以讓 main 部分 std::cout x+y的結果? 笨啊。




#include
#include
#include "calculat.h"

void main(void)
{
std::cout EnglishWeight(2,5);
std::cout
}

--------------------------- calculat.h ---------------------
class EnglishWeight
{
public:
typedef int Weight;
Weight temp;

EnglishWeight(Weight x, Weight y);
};

----------------------calculat.cpp-----------------------

#include
#include
#include "calculat.h"


EnglishWeight::EnglishWeight(int x, int y)
{

temp = x+y;
std::cout }

所有跟帖: 

回複:懂C++的大俠幫看看, 謝謝 -lidongmei- 給 lidongmei 發送悄悄話 (87 bytes) () 02/19/2006 postreply 15:46:01

是啊, 我這部分理論上好像清楚, 但使用上就糊塗了 -水年華- 給 水年華 發送悄悄話 (0 bytes) () 02/19/2006 postreply 15:54:01

方法如下。。 -北半球的孤單- 給 北半球的孤單 發送悄悄話 (110 bytes) () 02/19/2006 postreply 16:03:39

題目出的有問題?原題是打印磅還是轉換公製? -flywhc- 給 flywhc 發送悄悄話 (209 bytes) () 02/19/2006 postreply 17:31:56

回複:懂C++的大俠幫看看, 謝謝 -greenpine_1234- 給 greenpine_1234 發送悄悄話 (610 bytes) () 02/20/2006 postreply 12:01:22

std::cout << temp< } should be std::cout <<temp<<endl; } -greenpine_1234- 給 greenpine_1234 發送悄悄話 (0 bytes) () 02/20/2006 postreply 12:03:14

請您先登陸,再發跟帖!