http://neicole.blog.163.com/blog/static/357123272011415115728538/
用的是DEV-C++
错误看不出来,麻烦各位大侠帮帮忙....
编译器: Default compiler
执行 g++.exe...
g++.exe "F:\Temp\作业5\H5t2.cpp" -o "F:\Temp\作业5\H5t2.exe" -I"D:\Program Files (x86)\DEV-CPP\lib\gcc\mingw32\3.4.2\include" -I"D:\Program Files (x86)\DEV-CPP\include\c++\3.4.2\backward" -I"D:\Program Files (x86)\DEV-CPP\include\c++\3.4.2\mingw32" -I"D:\Program Files (x86)\DEV-CPP\include\c++\3.4.2" -I"D:\Program Files (x86)\DEV-CPP\include" -L"D:\Program Files (x86)\DEV-CPP\Lib"
In file included from D:/Program Files (x86)/DEV-CPP/include/c++/3.4.2/backward/iostream.h:31,
from F:\Temp\作业5\H5t2.cpp:11:
D:/Program Files (x86)/DEV-CPP/include/c++/3.4.2/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the
In file included from F:\Temp\作业5\H5t2.cpp:12:
F:\Temp\作业5\/nk.h:21: error: `operator double()' must be a nonstatic member function
F:\Temp\作业5\/nk.h:21: error: `operator double()' must take exactly one argument
F:\Temp\作业5\/nk.h:35: error: `operator double()' must be a nonstatic member function
F:\Temp\作业5\/nk.h:35: error: `operator double()' must take exactly one argument
F:\Temp\作业5\/nk.h: In function `operator double()':
F:\Temp\作业5\/nk.h:37: error: `meter' undeclared (first use this function)
F:\Temp\作业5\/nk.h:37: error: (Each undeclared identifier is reported only once for each function it appears in.)
F:\Temp\作业5\/nk.h:37: error: `kilometer' undeclared (first use this function)
F:\Temp\作业5\H5t2.cpp: In function `int main()':
F:\Temp\作业5\H5t2.cpp:25: error: missing terminating " character
F:\Temp\作业5\H5t2.cpp:26: error: expected primary-expression before '<<' token
F:\Temp\作业5\H5t2.cpp:42: error: `class nauticalmile_kilometer' used where a floating point value was expected
F:\Temp\作业5\H5t2.cpp:42: error: aggregate value used where a float was expected
F:\Temp\作业5\H5t2.cpp:43: error: `class nauticalmile_kilometer' used where a floating point value was expected
F:\Temp\作业5\H5t2.cpp:43: error: aggregate value used where a float was expected
F:\Temp\作业5\H5t2.cpp:44: error: `class nauticalmile_kilometer' used where a floating point value was expected
F:\Temp\作业5\H5t2.cpp:44: error: aggregate value used where a float was expected
F:\Temp\作业5\H5t2.cpp:45: error: `class nauticalmile_kilometer' used where a floating point value was expected
F:\Temp\作业5\H5t2.cpp:45: error: aggregate value used where a float was expected
执行结束
错在哪里,该怎么修改好呢?