Files
freeCodeCamp/guide/arabic/cplusplus/range-for-loop/index.md
2019-06-20 16:14:23 -05:00

29 lines
673 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: Range For Loop
localeTitle: نطاق للحلقة
---
## النطاق القائم للحلقة
ومقرها تراوحت `for` حلقة يسمح سهلة حلقات على مجموعة من العناصر (مثل عناصر في وعاء).
مع التقليدية `for` حلقة:
```cpp
std::vector<std::string> stringList {"one", "two", "three"};
for (size_t il; il < stringList.size(); il++
{
std::cout << stringList.at(il) << std::endl;
}
```
مع مجموعة المستندة `for` حلقة:
```cpp
std::vector<std::string> stringList {"one", "two", "three"};
for (auto& singleString : stringList)
{
std:cout << singleString << std::endl;
}
```