開発環境 Microsoft Visual C++ 2010 Express (SP1)
実行環境 Microsoft Windows XP Home Edition (SP3)
プロジェクトの種類 空の CLR プロジェクト
プロジェクト名 struniq

参考

struniq.cpp
using namespace System;
using namespace System::Collections::Generic;
 
int main()
{
	array<String^>^ arr = {"tako", "ika", "manbo", "tako"};
	List<String^>^ list = gcnew List<String^>;
 
	for each (String^ s in arr) {
		if (!list->Contains(s)) {
			list->Add(s);
		}
	}
 
	for each (String^ s in list) {
		Console::WriteLine(s);
	}
 
	Console::ReadLine();
	return 0;
}
 

出力
tako
ika
manbo
最終更新:2012年09月29日 20:15