Native/C++

map 사용 예

aucd29 2013. 10. 2. 18:57
[code]
#include "stdafx.h"
#include <map>
#include <string>

using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
    map<string,string> table;
    string s1 = "first";

    table["first"] = "Hello world";

    cout << table[s1] << endl; // 마치 php의 배열처럼 이용 가능하겠다.


    return 0;
}[/code]