
runn-time prakaar kii jaankaari

computer prograaming mein, runn-time prakaar kii jaankaari yaa runn-time prakaar kii pehchaan (aar. tii. tii. aaee.) kuchh prograaming bhaashaon (jaise see + +, object pascal aur aeye. dee. aeye.) kii ack visheshta haye joe runtime mein kissy vastu key detta prakaar key baare mein jaankaari koo ujagar karati haye. runn-time prakaar kii jaankaari sabhi prakaron key liye upalabdh hoe sakati haye yaa kewal una prakaron key liye upalabdh hoe sakati haye jinamen yeh spasht roop seey haye (jaisa kii aeye. dee. aeye. key mamle mein haye). runn-time prakaar kii jaankaari ack adhik samanya avadharana kaa ack visheshikaran haye jise prakaar aatmanireekshan kahaa jaataa haye.
mool see + + design mein, bjourn strostrup mein runn-time prakaar kii jaankaari shamil naheen thee, kyonki unhone socha thaa kii iss tantra kaa aksar durupyog kiya jaataa thaa.
avalokan.
see + + mein, rtti kaa upayog surakshit typecast karane key liye kiya jaa sakata haye, cocois _ 1 operator kaa upayog karke, aur runtime parr type jaankaari mein herfer karane key liye, cocois _ 2 operator aur cocois _ 3 class kaa upayog karke. object pascal mein, rtti kaa upayog cocois _ 4 operator key saath surakshit prakaar key cast karane key liye kiya jaa sakata haye, usa varg kaa pareekshan kiya jaa sakata haye jisamen ack vastu cocois _ 5 operator key saath sambandhit haye, aur cocois _ 6 ikai (i.ee. varg-"truticon text", "trtiinstancetype", aadi.). aeye. dee. aeye. mein, tagg kiye gaye prakaar kii vastuein bhee ack prakaar kaa tagg sangraheet karati hain, joe runtime parr inn vastu key prakaar kii pehchaan kii anumati detaa haye. yadi koee vastu ack vishisht prakaar kii haye aur usey surakshit roop seey usamen parivartit kiya jaa sakata haye, tou kokwe _ 7 prachaalak kaa upayog runtime parr pareekshan karane key liye kiya jaa sakata haye.
aar. tii. tii. aaee. kewal una vargon key liye upalabdh haye joe bahuroopi hain, jiska arth haye kii unake paas cumm seey cumm ack aabhaasi vidhi haye. vyavhaar mein, yeh ack seema naheen haye kyonki aadhar vargon mein ack aabhaasi vidhvansak honah chaahiye joe vyutpann vargon kii vastuon koo uchit safai karane kii anumati detaa haye yadi unhein aadhar soochak seey hataa diyaa jaataa haye.
kuchh sanklakon key paas aar. tii. tii. aaee. koo aksham karane key liye jhande hotey hain. inn jhandon kaa upayog karane seey anuprayog key samagr aakar koo cumm kiya jaa sakata haye, jisase way vishesh roop seey upayogi hoe sakate hain jaba way seemit matra mein smriti key saath pranaliyon koo lakshit karate hain.
see + +-"type".
runn time parr kissy vastu key varg koo nirdhaarit karane key liye kokwe _ 2 mukhya shabd kaa upayog kiya jaataa haye. yeh cock _ 3 object key liye ack sandarbh detaa haye, joe prograam key anta taka maujood haye. gair-bahuroopi sandarbh mein, cock _ 2 kaa upayog aksar aisee sthitiyon mein cock _ 11 parr pasand kiya jaataa haye jahaan kewal varg kii jaankaari kii aavashyakta hoti haye, kyonki cock _ 2 hamesha ack sthir-samay prakriya hoti haye, jabaki cock _ 13 koo runtime parr apane tark key varg vyutpatti jaali koo paar karane kii aavashyakta hoe sakati haye. vaapas kii gaee vastu key kuchh pahalu karyanvayan-paribhaashit hain, jaise kii cock _ 14, aur susangat honey key liye compilers parr bharosa naheen kiya jaa sakata haye.
varg cock _ 15 kii vastuon koo taba fenka jaataa haye jaba cock _ 2 key liye abhivyakti ack null pointer parr unary * operator koo lagu karane kaa parinam hoti haye. kyaa anya shoonya sandarbh tarkon key liye ack apavaad diyaa jaataa haye, yeh karyanvayan-nirbhar haye. dusare shabdon mein, apavaad kii guaranti key liye, abhivyakti koo coc _ 17 kaa roop lena chaahiye jahaan coc _ 18 koee bhee abhivyakti haye jisake parinamswarup ack null pointer hotaa haye.
udaaharan key liye.
varg vyakti {
saarvajanikah
 aabhaasi ~ vyakti () = default;
varg karmchaarih saarvajanik vyakti {};
int maine () {
 vyakti;
 karmchari;
 vyakti * pee. tii. aar. = & karmchari;
 vyakti aur ref = karmchari;
 //string typed dwara lauti gaeeh naam karyanvayan-paribhaashit haye.
 stdh cout "type (vyakti).naam ()
 stdh andle;// vyakti (saankhyikiya roop seey sankalan-samay parr jaanaa jaataa haye).
 stdh see. yuu. tii. type (karmchari).naam ()
 stdh andle;// karmchari (saankhyikiya roop seey sankalan-samay parr jaanaa jaataa haye).
 stdh see. yuu. tii. type (pee. tii. aar.).naam ()
 stdh andle;// vyakti * (saankhyikiya roop seey sankalan-samay parr jaanaa jaataa haye).
 stdh see. yuu. tii. type (* pee. tii. aar.).naam ()
 stdh andle;// karmchari (runn-time parr gatishil roop seey dekhaa gayaa)
 //kyonki yeh ack kaa avakalan haye
 //ack bahuroopi varg key liye soochak).
 stdh cout "type (riff).naam ()
 stdh andle;// karmchari (sandarbh bahuroopi bhee hoe sakate hain)
 vyakti * pee = nulter;
 koshish karein {
 type (* pee);// anirdhaarit vyavhaar naheen; stdh badd _ typied fenkta haye.
 vyakti & pee _ riff = * pee;// anirdhaarit vyavhaarah shoonya kaa ullekh karna
 typed (pee _ riff);// std fenkane kii aavashyaktaon koo puuraa naheen kartaa haih badd _ typed
 //kyonki typied key liye abhivyakti parinam naheen haye
 //uniry * operator koo lagu karane kaa.
output (sateek output system aur sankalak key anusaar bhinn hotaa haye):
 vyakti
 karmchari
 vyakti*
 karmchari
 karmchari
see + +-"dynamic cast" aur jaava cast.
c + + mein cocewy _ 13 prachaalak kaa upayog varg padanukram mein ack adhik vishisht prakaar key sandarbh yaa soochak koo neeche utaarane key liye kiya jaataa haye. cock _ 20 key vipareet, cock _ 13 kaa lakshya ack soochak yaa varg key liye sandarbh honah chaahiye. cock _ 20 aur see-style typecast (jahaan sankalan key dauran type check kiya jaataa haye) key vipareet, runtime parr ack prakaar kii suraksha jaanch kii jaati haye. yadi prakaar sangat naheen hain, tou ack apavaad fenk diyaa jaayega (sandarbhon key saath kaam karate samay) yaa ack null pointer vaapas curr diyaa jaayega (jaba sanketon key saath kaam karate hain).
ack jaava typecast isi tarah seey vyavhaar kartaa haye; yadi vastu vaastav mein lakshya prakaar kaa ack udaaharan naheen haye, aur bhasha-paribhaashit vidhi dwara ack mein parivartit naheen kiya jaa sakata haye, tou coquell _ 23 kaa ack udaaharan fenka jaayega.
udaaharan key liye.
maan leejiye kii kuchh kaary apane tark key roop mein ack prakaar key cock _ 24 kii vastu koo letaa haye, aur kuchh atirikt operation karna chaahata haye yadi object paas cock _ 25 kaa ack udaaharan haye, joe cock _ 24 kaa ack upavarg haye. ise nimnanusar cock _ 13 kaa upayog karke puuraa kiya jaa sakata haye.
namespace std kaa upayog karna;
varg aeye {
saarvajanikah
 //choonki aar. tii. tii. aaee. aabhaasi vidhi talika mein shamil haye, isaliye vahaan honah chaahiye
 //cumm seey cumm ack aabhaasi kaary.
 aabhaasi ~ a () = default;
 shoonya vidhi nirdisht () {
 cout "vidhi vishisht key liye ack ahwan kiya gayaa thaa" anta;
};
varg beeh saarvajanik aeye {
saarvajanikah
 shoonya vidhi nirdisht () {
 cout "vidhi bee key liye vishisht ahwan kiya gayaa thaa" anta;
};
shoonya meraa kaary (a & meraa _ a) {
 koshish karein {
 //cast kewal bee prakaar kii vastuon key liye safal hoga.
 b & my _ b = gatishil _ cast <b &> (my _ a);
 meraa bee.vidhi nirdisht ();
 } pakaden (sthir kharaab _ cast & ee) {
 see. aar. aar. "apavaad" ee.kyaa () "fenka gayaa."anta;
 vastu bee prakaar kii naheen haye" anta;
int maine () {
 sarani <advitiya _ ptr <a>, 3> sarani _ a;// aadhar varg a key liye sanketon kii sarani.
 sarani _ kaa _ a [0] = banaao _ advitiya <b> ();// b object key liye soochak.
 sarani _ kaa _ a [1] = banaao _ advitiya <b> ();// b object key liye soochak.
 sarani _ kaa _ a [2] = ack vastu key liye advitiya <a> ();// soochak banaaen.
 (int i = 0; i <3; + + i) key liye
 maay function (* array _ of _ a [i]);
kansol outputah
 bee key liye vishisht vidhi kaa ahwan kiya gayaa thaa
 bee key liye vishisht vidhi kaa ahwan kiya gayaa thaa
 apavaad stdh kharaab cast fenka gayaa.
 vastu bee prakaar kii naheen haye
cock _ 28 key samaan sanskaran koo sandarbhon key bajaay sanketon key saath likhaa jaa sakata haih
shoonya meraa kaary (a * meraa _ a) {
 b * meraa b = gatishil cast <b *> (meraa a);
 aggar (meraa bee!= nulter)
 meraa _ b-> vidhi-nirdisht ();
 aur bhee
 stdh crr "object bee type naheen haye" stdh andle;
delphi/object pascal.
object pascal mein, operator cock _ 5 kaa upayog runn time parr ack varg key prakaar kii jaanch karane key liye kiya jaataa haye. yeh kissy diye gaye varg seey sambandhit kissy vastu kaa pareekshan kartaa haye, jisamen viraasat key vriksh (ee.jee. "button 1" ack "" button "" varg haye jisake poorvaj hainh "" twincontroll "" → "" tecontrol "" → "" tuppersistent "" → "" tobject "," jahan baad vaalaa sabhi vargon kaa poorvaj haye).  prachaalak cock _ 4 kaa upayog taba kiya jaataa haye jaba kissy vastu koo runn time parr aise maanaa jaataa haye jaise kii vaha kissy poorvaj varg seey sambandhit hoe.
aar. tii. tii. aaee. ikai kaa upayog runn time parr object prakaar kii jaankaari mein herfer karane key liye kiya jaataa haye. iss ikai mein vargon kaa ack samooh hotaa haye joe aapako kissy vastu key varg aur usake poorvajon, gunon, vidhiyon aur ghatnaaon, sampatti moolyon aur coll vidhiyon koo badalane key baare mein jaankaari praapt karane kii anumati detaa haye. nimnalikhit udaaharan usa varg key baare mein jaankaari praapt karane key liye aar. tii. tii. aaee. module key upayog koo darshaata haye jisase ack vastu sambandhit haye, ise banaana aur isaki vidhi koo coll karna. udaaharan yeh maanata haye kii vishay varg koo vishay ikai naamak ikai mein ghoshit kiya gayaa haye.
upayog karein
 aar. tii. tii. aaee., vishay-ikai;
binaa pratibimban key prakriya;
varr
 meraa vishayah t-vishay;
shuru karein
 meraa vishayah = t vishay.banaaen;
 koshish karein
 vishay.namaskar;
 anta mein
 vishay.mukt;
 anta;
anta;
pratibimb key saath prakriya;
varr
 rtticontext: ttticontext;
 rttitype: trtiinstancetype;
 vishayah tobject;
shuru karein
 rttype: = rtticontext.findtype ('subjectunit.tsubject ') koo trtiinstancetype key roop mein;
 vishayah = rttype.gatemethode ('creat').ahwan karein (rttype.metaclogestipe, []).vastu;
 koshish karein
 rttype.gatemethode ('hallow').ahwan karein (vishay, []);
 anta mein
 vishay.mukt;
 anta;
anta;

