• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Zbugowany std::map

Dominik ms

Member
Joined
Jan 20, 2010
Messages
424
Reaction score
6
Napisałem w c++ taką funkcję:

PHP:
		AttacksAction* getAttack(std::string name)
		{
			AttacksActionsMap::iterator it = attacksMap.find(name);
				std::cout << ">>" << attacksMap.size() << std::endl;
			if(it != attacksMap.end());
			{
				std::cout << ">>>" << name << " - " << std::endl;
				return it->second;
            }

			return NULL;
		}

W konsoli wywala mi takie coś:
>>0
>>>Test

Jakim cudem znajduje wartość w tablicy, skoro cała mapa jest pusta?? A gdy próbuję użyć "it->second" to wywala crash.
 
Back
Top