18th Mar 2021, 10:30 AM
__n
__n - avatar
12 Answers
+ 2
U r not using the variable pb thats why it is giving warning for unuse variable. If you want to show pb as output then add cout<<pb; or cout<<sizeOf(pb);
18th Mar 2021, 10:53 AM
Sharique Khan
Sharique Khan - avatar
+ 1
u cant use static cast with unrelated class, cause they dont have same memory layout
18th Mar 2021, 11:45 AM
durian
durian - avatar
+ 1
__n checking out what static_cast and reinterpret_cast actually do helps more than asking on SoloLearn and waiting for an answer static_cast: https://en.cppreference.com/w/cpp/language/static_cast reinterpret_cast: https://en.cppreference.com/w/cpp/language/reinterpret_cast Also, when you have another question, instead of asking it in the same thread, please make a new one. Or even better, try to put all the questions you have about a certain topic in the same question.
18th Mar 2021, 1:13 PM
XXX
XXX - avatar
+ 1
XXX I didn't had another question i asked question of same code so.. and i was confused in that so i asked directly..on sololearn
18th Mar 2021, 1:24 PM
__n
__n - avatar
0
What's work of problem
18th Mar 2021, 10:53 AM
Rohit Maurya
Rohit Maurya - avatar
0
Can u tell me why we can't use static_cast here???
18th Mar 2021, 10:57 AM
__n
__n - avatar
0
Martin Taylor u mean static_cast is also applicable here..then??
18th Mar 2021, 11:02 AM
__n
__n - avatar
0
https://code.sololearn.com/c3Tl8me77fpH/?ref=app Now i replaced static in place of reinterpret ...now why its giving me error??
18th Mar 2021, 11:37 AM
__n
__n - avatar
0
Ohh thnx..Lily Mea
18th Mar 2021, 11:46 AM
__n
__n - avatar
0
__n that's what I addressed in the "Or, even better...." line. I'm saying that before asking a question, think for a minute and write all your questions at once. This is because when someone else has the same problem, it becomes easier to just link your question. It's okay that you asked a question in the same thread because the code was same, I'm just saying that it's always better to write all your questions at once in the questiom description. Happy coding.
18th Mar 2021, 2:13 PM
XXX
XXX - avatar
0
Okayy..thnk u😁
18th Mar 2021, 2:14 PM
__n
__n - avatar
0
Gg
20th Mar 2021, 3:23 PM
KF_SHADOW
KF_SHADOW - avatar