Hi, I'm trying to just create a map of with char[30] as the key, and type test as the value.
Code:
#include <stdio.h>
#include <stdlib.h>
#include <map>
#include <string.h>
int main()
{
struct test
{
int number;
char name[30];
};
typedef struct test test;
std::map <char[30], test*> buckets;
return 0;
}
However, when compiling, I get the error:
Code:
stupid.c: In function ‘int main()’:
stupid.c:23: error: template argument for ‘template<class _T1, class _T2> struct std::pair’ uses local type ‘main()::test’
stupid.c:23: error: trying to instantiate ‘template<class _T1, class _T2> struct std::pair’
stupid.c:23: error: template argument 4 is invalid
stupid.c:23: error: invalid type in declaration before ‘;’ token
What am I missing?