@Gokilla

Компилятор ругается?

void__ Scene2::DrawNumeric(int__ num,int__ position)
{
	int__ j = -1,jj=-1;
	std::string str = "";
	for (auto && v : std::to_string(num)) {
		//std::cout << v /*- '0'*/ << "|";
		str += v;
		++j;
		switch (str[j])
		{
		case '0':
		{
			glBindTexture(GL_TEXTURE_2D, IndexTexture[62]);
			EnableTexture(NewTextureCoordinats[0], NewVertexCoordinats[63+position], j);
			break;
		}
		case '1':
		{
			glBindTexture(GL_TEXTURE_2D, IndexTexture[63]);
			EnableTexture(NewTextureCoordinats[0], NewVertexCoordinats[63 + position], j);
			break;
		}
		case '2':
		{
			glBindTexture(GL_TEXTURE_2D, IndexTexture[64]);
			EnableTexture(NewTextureCoordinats[0], NewVertexCoordinats[63 + position], j);
			break;
		}
		case '3':
		{
			glBindTexture(GL_TEXTURE_2D, IndexTexture[65]);
			EnableTexture(NewTextureCoordinats[0], NewVertexCoordinats[63 + position], j);
			break;
		}
		case '4':
		{
			glBindTexture(GL_TEXTURE_2D, IndexTexture[66]);
			EnableTexture(NewTextureCoordinats[0], NewVertexCoordinats[63 + position], j);
			break;
		}
		case '5':
		{
			glBindTexture(GL_TEXTURE_2D, IndexTexture[67]);
			EnableTexture(NewTextureCoordinats[0], NewVertexCoordinats[63 + position], j);
			break;
		}
		case '6':
		{
			glBindTexture(GL_TEXTURE_2D, IndexTexture[68]);
			EnableTexture(NewTextureCoordinats[0], NewVertexCoordinats[63 + position], j);
			break;
		}
		case '7':
		{
			glBindTexture(GL_TEXTURE_2D, IndexTexture[69]);
			EnableTexture(NewTextureCoordinats[0], NewVertexCoordinats[63 + position], j);
			break;
		}
		case '8':
		{
			glBindTexture(GL_TEXTURE_2D, IndexTexture[70]);
			EnableTexture(NewTextureCoordinats[0], NewVertexCoordinats[63 + position], j);
			break;
		}
		case '9':
		{
			glBindTexture(GL_TEXTURE_2D, IndexTexture[71]);
			EnableTexture(NewTextureCoordinats[0], NewVertexCoordinats[63 + position], j);
			break;
		}
		}
	}
}

ошибки в вижуалке 2015 все ок, а в 2010 вот в строке с for:
Ошибка 11 error C2143: синтаксическая ошибка: отсутствие "," перед ":" E:\флешка\other\nottoch\Tropic-Island\Tropic-Island\game3\research_very_goodZZZ\Scene2.cpp 452
Ошибка 12 error C2530: v: ссылки должны быть инициализированы E:\флешка\other\nottoch\Tropic-Island\Tropic-Island\game3\research_very_goodZZZ\Scene2.cpp 452
Ошибка 13 error C3531: v: символ, тип которого содержит спецификатор "auto" должен иметь инициализатор E:\флешка\other\nottoch\Tropic-Island\Tropic-Island\game3\research_very_goodZZZ\Scene2.cpp 452
Ошибка 14 error C2143: синтаксическая ошибка: отсутствие ";" перед "{" E:\флешка\other\nottoch\Tropic-Island\Tropic-Island\game3\research_very_goodZZZ\Scene2.cpp 452
  • Вопрос задан
  • 38 просмотров
Пригласить эксперта
Ответы на вопрос 1
Компилятор, который в 2010 студии, скорее всего просто не знает, что вот так писать уже можно.
for (auto && v : std::to_string(num))
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы