C++ casting and type conversion in place | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

C++ casting and type conversion in place

Is it possible to cast a variable in place? this is what I’m going for: char a = 5; cast a to int a = 10000;

11th Sep 2022, 5:40 AM
ITDW
1 Answer
+ 1
yes, thera 5 types of cast possible in core c++ 1) static cast 2) dynamic cast 3) reinterpret cast 4) const cast 5) cstyle cast - https://en.cppreference.com/w/cpp/language/explicit_cast
11th Sep 2022, 5:44 AM
Prashanth Kumar
Prashanth Kumar - avatar