Borderou de evaluare (job #1434518)
Utilizator | Data | 10 mai 2015 19:00:16 | |
---|---|---|---|
Problema | Curatenie | Status | done |
Runda | Arhiva de probleme | Compilator | cpp | Vezi sursa |
Scor | 0 |
Raport evaluator
Eroare de compilare:
user.cpp:20:5: error: ‘int index’ redeclared as different kind of symbol
int index;
^
In file included from user.cpp:6:0:
/usr/include/string.h:482:1: error: previous declaration of ‘const char* index(const char*, int)’
index (__const char *__s, int __c) __THROW
^
user.cpp: In function ‘TreeNode* obtainTree(int, int)’:
user.cpp:29:29: error: invalid operands of types ‘<unresolved overloaded function type>’ and ‘std::vector<int>::size_type {aka unsigned int}’ to binary ‘operator>=’
if (index >= preOrder.size())
^
user.cpp:39:24: error: no match for ‘operator[]’ (operand types are ‘std::vector<int>’ and ‘<unresolved overloaded function type>’)
node->value = preOrder[index];
^
user.cpp:39:24: note: candidates are:
In file included from /usr/include/c++/4.8/vector:64:0,
from user.cpp:3:
/usr/include/c++/4.8/bits/stl_vector.h:770:7: note: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::reference = int&; std::vector<_Tp, _Alloc>::size_type = unsigned int]
operator[](size_type __n)
^
/usr/include/c++/4.8/bits/stl_vector.h:770:7: note: no known conversion for argument 1 from ‘<unresolved overloaded function type>’ to ‘std::vector<int>::size_type {aka unsigned int}’
/usr/include/c++/4.8/bits/stl_vector.h:785:7: note: std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) const [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::const_reference = const int&; std::vector<_Tp, _Alloc>::size_type = unsigned int]
operator[](size_type __n) const
^
/usr/include/c++/4.8/bits/stl_vector.h:785:7: note: no known conversion for argument 1 from ‘<unresolved overloaded function type>’ to ‘std::vector<int>::size_type {aka unsigned int}’
user.cpp:44:9: error: no post-increment operator for type
index++;
^
user.cpp:49:9: error: no post-increment operator for type
index++;
^
user.cpp: In function ‘int main()’:
user.cpp:98:12: warning: unused variable ‘root’ [-Wunused-variable]
TreeNode *root = obtainTree(0, N - 1);
^
Ceva nu functioneaza?
- Citeste despre borderoul de evaluare.
- Daca tot nu e bine, contacteaza-ne pe forum !