So here is my problem, I was writing just a simple code in C++, since I am a beginner, and I stumbled upon a problem. First at all the code:
case 4:
std::cout << "a b c: \n";
std::cin >> a >> b >> c;
auto[newA, newB, newC] = calculateSSS(A, B, C, a, b, c);
std::cout << "A, B and C are: " << std::setprecision(1) << std::fixed << newA << "; " << newB << "; " << newC << '\n';
break;
default:
exit;
}
return 0;
The terminal tells me that the variables in "auto" (so newA, newB and newC) crosses initialization and it doesn't tell me anything about default, so I don't know what the error might be.
Everywhere else, without the default, it worked out. Also, if I remove the default case, it works out just fine out of nowhere. Please anyone tell me what the problem seems to be