clude <vector>
     
    int main()
    {
        int a[]{4, 6, -3, 9, 10};
        [std::cout](http://en.cppreference.com/w/cpp/io/cout) << "Array backwards: ";
        namespace ranges = std::ranges;
        [ranges::copy](http://en.cppreference.com/w/cpp/ranges-algorithm-placeholder/copy)([ranges::rbegin](http://en.cppreference.com/w/cpp/ranges/rbegin)(a), [ranges::rend](http://en.cppreference.com/w/cpp/ranges/rend)(a),
                     [std::ostream_iterator](http://en.cppreference.com/w/cpp/iterator/ostream_iterator)<int>([std::cout](http://en.cppreference.com/w/cpp/io/cout), " "));
        [std::cout](http://en.cppreference.com/w/cpp/io/cout) << '\n';
     
        [std::cout](http://en.cppreference.com/w/cpp/io/cout) << "Vector backwards: ";
        [std::vector](http://en.cppreference.com/w/cpp/container/vector) v{4, 6, -3, 9, 10};
        [ranges::copy](http://en.cppreference.com/w/cpp/ranges-algorithm-placeholder/copy)([ranges::rbegin](http://en.cppreference.com/w/cpp/ranges/rbegin)(v), [ranges::rend](http://en.cppreference.com/w/cpp/ranges/rend)(v),
                     [std::ostream_iterator](http://en.cppreference.com/w/cpp/iterator/ostream_iterator)<int>([std::cout](http://en.cppreference.com/w/cpp/io/cout), " "));
        [std::cout](http://en.cppreference.com/w/cpp/io/cout) << '\n';
    }

Output:

    
    
    Array backwards: 10 9 -3 6 4
    Vector backwards: 10 9 -3 6 4

###  [ [ edit ](/mwiki/index.php?title=cpp/ranges/crend&action=edit&section=2
"Edit section: See also") ]  See also

[ ranges::rend  ](/w/cpp/ranges/rend "cpp/ranges/rend") (C++20)  |  returns a reverse end iterator to a range   
(customization point object)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/dsc_rend&action=edit)  
---|---  
[ rend  crend  ](/w/cpp/iterator/rend "cpp/iterator/rend") (C++14)  |  returns a reverse end iterator for a container or array   
(function template)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/iterator/dsc_rend&action=edit)  
  
Retrieved from " [
https://en.cppreference.com/mwiki/index.php?title=cpp/ranges/crend&oldid=158245
](https://en.cppreference.com/mwiki/index.php?title=cpp/ranges/crend&oldid=158245)
"

#####  Navigation

  * [ Support us ](http://www.cppreference.com/support)
  * [ Recent changes ](/w/Special:RecentChanges "A list of recent changes in the wiki \[r\]")
  * [ FAQ ](/w/Cppreference:FAQ)
  * [ Offline version ](/w/Cppreference:Archives)

#####  Toolbox

  * [ What links here ](/w/Special:WhatLinksHere/cpp/ranges/crend "A list of all wiki pages that link here \[j\]")
  * [ Related changes ](/w/Special:RecentChangesLinked/cpp/ranges/crend "Recent changes in pages linked from this page \[k\]")
  * [ Upload file ](http://upload.cppreference.com/w/Special:Upload "Upload files \[u\]")
  * [ Special pages ](/w/Special:SpecialPages "A list of all special pages \[q\]")
  * [ Printable version ](/mwiki/index.php?title=cpp/ranges/crend&printable=yes "Printable version of this page \[p\]")
  * [ Permanent link ](/mwiki/index.php?title=cpp/ranges/crend&oldid=158245 "Permanent link to this revision of the page")
  * [ Page information ](/mwiki/index.php?title=cpp/ranges/crend&action=info)

  * In other languages 

  * [ Deutsch ](http://de.cppreference.com/w/cpp/ranges/crend "cpp/ranges/crend")
  * [ Español ](http://es.cppreference.com/w/cpp/ranges/crend "cpp/ranges/crend")
  * [ 日本語 ](http://ja.cppreference.com/w/cpp/ranges/crend "cpp/ranges/crend")
  * [ Русский ](http://ru.cppreference.com/w/cpp/ranges/crend "cpp/ranges/crend")
  * [ 中文 ](http://zh.cppreference.com/w/cpp/ranges/crend "cpp/ranges/crend")

  * This page was last modified on 8 September 2023, at 10:30. 
  * This page has been accessed 10,139 times. 

  * [ Privacy policy ](/w/Cppreference:Privacy_policy "Cppreference:Privacy policy")
  * [ About cppreference.com ](/w/Cppreference:About "Cppreference:About")
  * [ Disclaimers ](/w/Cppreference:General_disclaimer "