
please wait
|
|
|
|
wordcounts[s][i]++;
c:\program files\microsoft visual studio 9.0\vc\include\map(173) : error C2440: '<function-style-cast>' : cannot convert from 'int' to 'int [5]' There are no conversions to array types, although there are conversions to references or pointers to arrays c:\program files\microsoft visual studio 9.0\vc\include\map(168) : while compiling class template member function 'int (&std::map<_Kty,_Ty>::operator [](const std::basic_string<_Elem,_Traits,_Ax> &))[5]' with [ _Kty=std::string, _Ty=int [5], _Elem=char, _Traits=std::char_traits<char>, _Ax=std::allocator<char> ] c:\documents and settings\bakerkar\my documents\visual studio 2008\projects\mapattempt\mapattempt\maptry.cpp(9) : see reference to class template instantiation 'std::map<_Kty,_Ty>' being compiled with [ _Kty=std::string, _Ty=int [5] ] |
|
|
Debug Assertion Failed! Program: …s\Visual Studio 2008\Projects\mapAttempt\Debug\mapAttempt.exe File: c:\program files\microsoft visual studio 9.0\vc\include\vector Line: 779 Expression: vector subscript out of range For information on how your program can cause an assertion failure, see the Visual C++ documentation on asserts. |
size()
is 0. You can resize your vector by push_back()
-ing items, or by calling the appropriate constructor vector<int> sentence(5);
, or by calling the resize()
member function.
|
|
vector<int> sentence(5);
suggestion but still got the same error.(Word_1) (# of occurrences in sentence_1) (# of occurrences in sentence_2)...(# of occurrences in sentence_n) ..... (Word_n) (# of occurrences in sentence_1) (# of occurrences in sentence_2)...(# of occurrences in sentence_n) |
error C2679: binary '>>' : no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion) |
(Word_1)(# of occurrences in sentence_1+sentence_2+...+sentence_n) ... (Word_n)(# of occurrences in sentence_1+sentence_2+...+sentence_n) |