Questions tagged «loop-counter»

13
何时使用std :: size_t?
我只是想知道我应该使用std::size_t循环和东西而不是int?例如: #include <cstdint> int main() { for (std::size_t i = 0; i < 10; ++i) { // std::size_t OK here? Or should I use, say, unsigned int instead? } } 通常,关于何时使用的最佳实践是什么std::size_t?
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.