リスト内の指定された位置の要素に値を設定します。
void SetAt(
POSITION pos,
INARGTYPE element
);
パラメーター
pos
変更する要素に対応する POSITION 値。element
新しい要素の値。
解説
既存の値を element で置き換えます。 デバッグ ビルドでは、pos が NULL である場合にアサーション エラーが発生します。
使用例
// Define the integer list
CAtlList<int> myList;
// Populate the list
myList.AddTail(100);
myList.AddTail(200);
// Use SetAt to change the values stored in the head and
// tail of the list
myList.SetAt(myList.GetHeadPosition(), myList.GetHead() * 10);
myList.SetAt(myList.GetTailPosition(), myList.GetTail() * 10);
// Confirm the values
ATLASSERT(myList.GetHead() == 1000);
ATLASSERT(myList.GetTail() == 2000);
必要条件
**ヘッダー:**atlcoll.h