Skip to content

Latest commit

 

History

History
94 lines (80 loc) · 1.85 KB

deque-at-stl-clr.md

File metadata and controls

94 lines (80 loc) · 1.85 KB
title deque::at (STL/CLR) | Microsoft Docs
ms.custom
ms.date 11/04/2016
ms.reviewer
ms.suite
ms.technology
cpp-windows
ms.tgt_pltfrm
ms.topic reference
f1_keywords
cliext::deque::at
dev_langs
C++
helpviewer_keywords
at member [STL/CLR]
ms.assetid 9af83d8a-c519-4b2a-a25f-d3dc8bbb87fb
caps.latest.revision 18
author mikeblome
ms.author mblome
manager ghogen
translation.priority.ht
cs-cz
de-de
es-es
fr-fr
it-it
ja-jp
ko-kr
pl-pl
pt-br
ru-ru
tr-tr
zh-cn
zh-tw

deque::at (STL/CLR)

Accesses an element at a specified position.

Syntax

reference at(size_type pos);  

Parameters

pos
Position of element to access.

Remarks

The member function returns a reference to the element of the controlled sequence at position pos. You use it to read or write an element whose position you know.

Example

// cliext_deque_at.cpp   
// compile with: /clr   
#include <cliext/deque>   
  
int main()   
    {   
    cliext::deque<wchar_t> c1;   
    c1.push_back(L'a');   
    c1.push_back(L'b');   
    c1.push_back(L'c');   
  
// display contents " a b c" using at   
    for (int i = 0; i < c1.size(); ++i)   
        System::Console::Write(" {0}", c1.at(i));   
    System::Console::WriteLine();   
  
// change an entry and redisplay   
    c1.at(1) = L'x';   
    for (int i = 0; i < c1.size(); ++i)   
        System::Console::Write(" {0}", c1[i]);   
    System::Console::WriteLine();   
    return (0);   
    }  
  
a b c  
a x c  

Requirements

Header: <cliext/deque>

Namespace: cliext

See Also

deque (STL/CLR)
deque::operator(STL/CLR)