12:46

36 views
Skip to first unread message

abaa...@hotmail.com

unread,
Apr 25, 2023, 2:57:18 PM4/25/23
to noc23-cs5...@nptel.iitm.ac.in
Hi,

I have a question about what is happening in this video at 00:12:46 -

http://www.youtube.com/watch?v=sQ6EmOzXdSg#t=766s.

Please could you clarify if this means it is okay to perform a downcast using the dynamic cast. I was under the impression that the downcast should not be performed/ avoided in all cases..

Thanks!



Reference Key - Key('StudentQuestionEntity', 5796030654709760, namespace='ns_noc23_cs50')

Arup Kumar Chattopadhyay

unread,
Apr 25, 2023, 10:28:01 PM4/25/23
to Discussion forum for Programming in Modern C++, abaa...@hotmail.com
The rule is "a pointer or a reference must point or refer to its own type object or derived (child) type object"; otherwise, it will raise an error or exception.

An Anubha

unread,
Apr 26, 2023, 4:49:41 AM4/26/23
to Arup Kumar Chattopadhyay, Discussion forum for Programming in Modern C++
Thanks so much for answering all my queries. 

Sent from Outlook for Android


From: Arup Kumar Chattopadhyay <arden...@gmail.com>
Sent: Wednesday, 26 April 2023, 03:28
To: Discussion forum for Programming in Modern C++ <noc23-cs5...@nptel.iitm.ac.in>
Cc: abaa...@hotmail.com <abaa...@hotmail.com>
Subject: Re: 12:46
Reply all
Reply to author
Forward
0 new messages