El error “xxxx” no nombra un tipo
Encontré un problema al intentar compilar el siguiente código:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <map>
using namespace std;
map<char, int> mapDial;
mapDial['A'] = 2;
int main()
{
cout << mapDial['A'] << endl;
return 0;
}
El compilador me dio un error: 'mapDial' no nombra un error de tipo. Soy nuevo en c ++ y realmente no sé qué está pasando aquí. ¿Alguien aquí me puede ayudar a resolver esto? ¡¡Gracias!!