Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

almost 3 years ago

Language

C++

Compiler

gcc 12.1.0

Options
Warnings
Optimization
Don't Use Boost
C++11
-pedantic

Author

anonymous

almost 3 years ago

$ g++ prog.cc -Wall -Wextra -O2 -march=native -std=c++11 -pedantic
prog.cc: In function 'int main()':
prog.cc:8:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::unordered_map<int, int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    8 |         for (int i = 0; i < hash.size(); i++) {
      |                         ~~^~~~~~~~~~~~~
i = 0, hash.size() = 2
i = 1, hash.size() = 3
hash[i] == 1
i = 2, hash.size() = 3
i = 3, hash.size() = 4
i = 4, hash.size() = 5
i = 5, hash.size() = 6
i = 6, hash.size() = 7
i = 7, hash.size() = 8
i = 8, hash.size() = 9
i = 9, hash.size() = 10
i = 10, hash.size() = 11
Exit Code:
0