const_cast and UB
What is the output of this program?
#include <iostream>
int main() {
const int i = 0;
int& r = const_cast<int&>(i);
r = 1;
std::cout << r;
}
Sign in to answer questions and track your progress
Sign InWhat is the output of this program?
#include <iostream>
int main() {
const int i = 0;
int& r = const_cast<int&>(i);
r = 1;
std::cout << r;
}
Sign in to answer questions and track your progress
Sign In