OSDN Git Service
(root)
/
oi-wiki
/
main.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9b5c0d4
)
Update map.md
author
Siyuan
<294873684@qq.com>
Thu, 30 Aug 2018 13:17:31 +0000
(21:17 +0800)
committer
GitHub
<noreply@github.com>
Thu, 30 Aug 2018 13:17:31 +0000
(21:17 +0800)
docs/ds/stl/map.md
patch
|
blob
|
history
diff --git
a/docs/ds/stl/map.md
b/docs/ds/stl/map.md
index
351821a
..
7bfe56e
100644
(file)
--- a/
docs/ds/stl/map.md
+++ b/
docs/ds/stl/map.md
@@
-42,7
+42,7
@@
map <string,int> mp= {
格式:`if(mp.find()==mp.end())`,意思是如果返回的是 `map` 的末尾,因为 `map` 如果没有查找到元素,迭代器会返回末尾。
-其中 `
``mp.end()``
` 返回指向map尾部的迭代器
+其中 `
mp.end()
` 返回指向map尾部的迭代器
3.如果你想知道map里全部的元素,那么最正确的做法使用迭代器了,如果你还不会,请查阅之前文章中的迭代器。
@@
-51,7
+51,7
@@
for(iter=mp.begin();iter!=mp.end();iter++)
cout<<iter->first<<" "<<iter->second<<endl;
```
-其中 `
``mp.begin()``
` 返回指向map头部的迭代器
+其中 `
mp.begin()
` 返回指向map头部的迭代器
`iter->first` 是 `map` 索引,例如 `Tom`,而 `iter->second` 是下标。