Sorry about the confusion.
When I tried to compile without
perimeter += distance (triangles[a].point1, triangles[a].point2); |
, it runs perfectly.
As I tried to compile with it, it shows compile error.
Here is the error message that I got.
1>------ Build started: Project: Assignment 5 part 3_1, Configuration: Debug Win32 ------
1>Build started 2014-07-14 오전 1:51:31.
1>InitializeBuildStatus:
1> Touching "Debug\Assignment 5 part 3_1.unsuccessfulbuild".
1>ClCompile:
1> problem3.cpp
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(373): error C2039: 'iterator_category' : is not a member of 'Point'
1> c:\users\jin\documents\visual studio 2010\projects\assignment 5 part 3_1\assignment 5 part 3_1\problem3.cpp(9) : see declaration of 'Point'
1> c:\users\jin\documents\visual studio 2010\projects\assignment 5 part 3_1\assignment 5 part 3_1\problem3.cpp(58) : see reference to class template instantiation 'std::iterator_traits<_Iter>' being compiled
1> with
1> [
1> _Iter=Point
1> ]
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(373): error C2146: syntax error : missing ';' before identifier 'iterator_category'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(373): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(373): error C2602: 'std::iterator_traits<_Iter>::iterator_category' is not a member of a base class of 'std::iterator_traits<_Iter>'
1> with
1> [
1> _Iter=Point
1> ]
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(373) : see declaration of 'std::iterator_traits<_Iter>::iterator_category'
1> with
1> [
1> _Iter=Point
1> ]
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(373): error C2868: 'std::iterator_traits<_Iter>::iterator_category' : illegal syntax for using-declaration; expected qualified-name
1> with
1> [
1> _Iter=Point
1> ]
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(374): error C2039: 'value_type' : is not a member of 'Point'
1> c:\users\jin\documents\visual studio 2010\projects\assignment 5 part 3_1\assignment 5 part 3_1\problem3.cpp(9) : see declaration of 'Point'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(374): error C2146: syntax error : missing ';' before identifier 'value_type'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(374): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(374): error C2602: 'std::iterator_traits<_Iter>::value_type' is not a member of a base class of 'std::iterator_traits<_Iter>'
1> with
1> [
1> _Iter=Point
1> ]
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(374) : see declaration of 'std::iterator_traits<_Iter>::value_type'
1> with
1> [
1> _Iter=Point
1> ]
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(374): error C2868: 'std::iterator_traits<_Iter>::value_type' : illegal syntax for using-declaration; expected qualified-name
1> with
1> [
1> _Iter=Point
1> ]
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(375): error C2039: 'difference_type' : is not a member of 'Point'
1> c:\users\jin\documents\visual studio 2010\projects\assignment 5 part 3_1\assignment 5 part 3_1\problem3.cpp(9) : see declaration of 'Point'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(375): error C2146: syntax error : missing ';' before identifier 'difference_type'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(375): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(375): error C2602: 'std::iterator_traits<_Iter>::difference_type' is not a member of a base class of 'std::iterator_traits<_Iter>'
1> with
1> [
1> _Iter=Point
1> ]
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(375) : see declaration of 'std::iterator_traits<_Iter>::difference_type'
1> with
1> [
1> _Iter=Point
1> ]
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(375): error C2868: 'std::iterator_traits<_Iter>::difference_type' : illegal syntax for using-declaration; expected qualified-name
1> with
1> [
1> _Iter=Point
1> ]
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(377): error C2039: 'pointer' : is not a member of 'Point'
1> c:\users\jin\documents\visual studio 2010\projects\assignment 5 part 3_1\assignment 5 part 3_1\problem3.cpp(9) : see declaration of 'Point'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(377): error C2146: syntax error : missing ';' before identifier 'pointer'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(377): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(377): error C2602: 'std::iterator_traits<_Iter>::pointer' is not a member of a base class of 'std::iterator_traits<_Iter>'
1> with
1> [
1> _Iter=Point
1> ]
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(377) : see declaration of 'std::iterator_traits<_Iter>::pointer'
1> with
1> [
1> _Iter=Point
1> ]
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(377): error C2868: 'std::iterator_traits<_Iter>::pointer' : illegal syntax for using-declaration; expected qualified-name
1> with
1> [
1> _Iter=Point
1> ]
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(378): error C2039: 'reference' : is not a member of 'Point'
1> c:\users\jin\documents\visual studio 2010\projects\assignment 5 part 3_1\assignment 5 part 3_1\problem3.cpp(9) : see declaration of 'Point'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(378): error C2146: syntax error : missing ';' before identifier 'reference'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(378): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(378): error C2602: 'std::iterator_traits<_Iter>::reference' is not a member of a base class of 'std::iterator_traits<_Iter>'
1> with
1> [
1> _Iter=Point
1> ]
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(378) : see declaration of 'std::iterator_traits<_Iter>::reference'
1> with
1> [
1> _Iter=Point
1> ]
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(378): error C2868: 'std::iterator_traits<_Iter>::reference' : illegal syntax for using-declaration; expected qualified-name
1> with
1> [
1> _Iter=Point
1> ]
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.78
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========