⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 equal.html

📁 从www.CppReference.com打包的C++参考手册
💻 HTML
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head>  <meta name="generator" content=  "HTML Tidy for Linux/x86 (vers 1 September 2005), see www.w3.org">  <title>equal</title>  <link href="../cppreference.css" rel="stylesheet" type="text/css"></head><body><table>  <tr>  <td>  <div class="body-content">  <div class="header-box">    <a href="../index.html">cppreference.com</a> &gt; <a href=    "index.html">C++ Algorithms</a> &gt; <a href="equal.html">equal</a>  </div>  <div class="name-format">    equal  </div>  <div class="syntax-name-format">    Syntax:  </div>  <pre class="syntax-box">  #include &lt;algorithm&gt;  bool equal( iterator start1, iterator end1, iterator start2 );  bool equal( iterator start1, iterator end1, iterator start2, BinPred p );</pre>  <p>The equal() function returns true if the elements in two ranges  are the same. The first range of elements are those between  <em>start1</em> and <em>end1</em>. The second range of elements has  the same size as the first range but starts at <em>start2</em>.</p>  <p>If the binary predicate <em>p</em> is specified, then it is used  instead of == to compare each pair of elements.</p>  <p>For example, the following code uses equal() to compare two  vectors of integers:</p>  <pre class="example-code"> vector&lt;int&gt; v1; for( int i = 0; i &lt; 10; i++ ) {   v1.push_back( i ); }               vector&lt;int&gt; v2; for( int i = 0; i &lt; 10; i++ ) {   v2.push_back( i ); }               if( equal( v1.begin(), v1.end(), v2.begin() ) ) {   cout &lt;&lt; &quot;v1 and v2 are equal&quot; &lt;&lt; endl; } else {   cout &lt;&lt; &quot;v1 and v2 are NOT equal&quot; &lt;&lt; endl; }              </pre>  <div class="related-name-format">    Related topics:  </div>  <div class="related-content">    <a href="find_if.html">find_if</a><br>    <a href=    "lexicographical_compare.html">lexicographical_compare</a><br>    <a href="mismatch.html">mismatch</a><br>    <a href="search.html">search</a>  </div>  </div>  </td>    </tr>  </table></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -