01-05-2006, 23:25
|
|
|
|
חבר מתאריך: 20.06.03
הודעות: 5,616
|
|
הנ דוגמת קוד שכתבתי על מנת שזה יעבוד...
תוכל לבדוק את הקוד שלך בהתאמה:
קוד:
#include <map>
#include <iostream>
#include <string>
using namespace std;
int main(int argc, _TCHAR* argv[])
{
typedef map<string,int> Index;
Index i;
i["ziv"] = 10;
cout << i["ziv"];
return 0;
}
וגרסה ללא using:
קוד:
#include <map>
#include <iostream>
#include <string>
int main(int argc, _TCHAR* argv[])
{
typedef std::map<std::string,int> Index;
Index i;
i["ziv"] = 10;
std::cout << i["ziv"];
return 0;
}
|