I am trying to use char[] as a key for a map:
#include<iostream>
#include<map>
#include<string>
#include<utility>
#include<list>
using namespace std;
int main(void)
{
map<char[10],int> m;
char c[10]={'1','2','3','4','5','6','7','8','9','0'};
m[c]=78;
return 0;
}
But is throwing an error:
error: array used as initializer
second(std::forward<_Args2>(std::get<_Indexes2>(__tuple2))...)
even this doesn't work: m["abcdefghi"]=4;
How to use char [] as a key? I have couple of questions on SO but they didn't help much.
NOTE: I have used string but I want to try char[] just for curiosity