
samagr detta prakaar

computer vigyaan mein, ack samagr detta prakaar yaa yaugik detta prakaar koee bhee detta prakaar haye jise prograaming bhasha key adim detta prakaron aur anya samagr prakaron kaa upayog karke ack prograam mein banaaya jaa sakata haye. ise kabhi-kabhi ack sanrachana yaa samagr prakaar kahaa jaataa haye, halanki baad vaalaa shabd sarani, soochiyon aadi koo bhee sandarbhit curr sakata haye. ack mishrit prakaar key nirmaan key kaary koo rachana key roop mein jaanaa jaataa haye. samagr detta prakaar aksar scalar charr key vipareet hotey hain.
see/see + + sanrachanaaen aur varg.
ack cocksey _ 1 ack samagr prakaar kii see aur see + + kii dhaarana haye, ack detta type joe label kiye gaye kshetron yaa sadasyon key ack nishchit sett kii rachana kartaa haye. ise unhein ghoshit karane mein upayog kiye jaane vaale cocksey _ 1 mukhya shabd key kaaran kahaa jaataa haye, joe "sanrachana" yaa, adhik sateek roop seey, "upayogkarta-paribhaashit detta sanrachana" key liye chhota haye.
see + + mein, ack cocois _ 1 aur ack varg key beach ekmatra antar default abhigam star haye, joe vargon key liye "niji" aur cocois _ 1s key liye "saarvajanik" haye.
dhyaan dein kii jabaki c + + mein varg aur cocoice _ 5 mukhya shabd poori tarah seey nae they, c prograaming bhasha mein pahale seey hii ack kachche prakaar kaa cocoice _ 1s thaa. sabhi uddeshyon aur uddeshyon key liye, c + + cocue _ 1s, c cocue _ 1s kaa ack superset banaata haih lagbhag sabhi maanya c cocue _ 1s, samaan shabdarth key saath maanya c + + cocue _ 1s hain.
ghoshana.
ack cocksey _ 1 ghoshana mein kshetron kii ack soochi hoti haye, jinamen seey pratyek mein kissy bhee prakaar kaa hoe sakata haye. ack cocksey _ 1 vastu key liye aavashyak kull bhandaran sabhi kshetron kii bhandaran aavashyaktaon kaa yog haye, saath hii kissy bhee aantarik padding.
udaaharan key liyeh
sanrachana khaata {
 antarvarti khaata sankhya (_ n);
 charr * pahala naam;
 charr * antim naam;
 float santulan;
ack prakaar koo paribhaashit kartaa haye, jise cocksey _ 13 key roop mein sandarbhit kiya jaataa haye. iss prakaar kaa ack nayaa charr banaane key liye, humm cocksey _ 14 likh sakate hain.
jisamen ack purnank ghatak haye, jise cocksey _ 15 dwara axes kiya jaataa haye, aur ack floating-point ghatak haye, jise cocksey _ 16 dwara axes kiya jaataa haye, saath hii saath cocksey _ 17 aur cocksey _ 18 ghatak bhee hotey hain. sanrachana cocois _ 19 mein sabhi chaar maan hotey hain, aur sabhi chaar kshetron koo swatantra roop seey badala jaa sakata haye.
choonki code mein baar-baar cocksey _ 13 likhana bojhil hoe jaataa haye, isaliye cocksey _ 1 key liye adhik suvidhajanak paryaayavaachi pradaan karane key liye see code mein cocksey _ 21 kathan dekhana asamanya naheen haye. haalaanki, kuchh prograaming shally guide isake khilaf salah dete hain, yeh daavaa karate hue kii yeh prakaar koo aspasht curr sakata haye.
udaaharan key liyeh
typedeff sanrachana khaata (_ I) {
 antarvarti khaata sankhya (_ n);
 charr * pahala naam;
 charr * antim naam;
 float santulan;
} khaata;
see + + code mein, cocos _ 21 kii aavashyakta naheen haye kyonki cocos _ 1 kaa upayog karke paribhaashit prakaar pahale seey hii niyamit namespace kaa hissa hain, isaliye prakaar koo yaa tou cocos _ 13 yaa buss cocos _ 26 key roop mein sandarbhit kiya jaa sakata haye.
ack anya udaaharan key roop mein, ack tri-ayami sadish samagr prakaar joe floating point detta prakaar kaa upayog kartaa haye, isake saath banaaya jaa sakata haih
sanrachana sadish {
 float aiks;
 float vaaee;
 float jaid;
cocos _ 27 naamak charr koo cocos _ 28 samagr prakaar key saath ghoshit kiya jaayega kyonki cocos _ 27 key 29 sadasyon koo ack bindu sanketan kaa upayog karke axes kiya jaayega. udaaharan key liye, cocksey _ 31, cocksey _ 27 key cocksey _ 32 ghatak koo 5 key barabar nirdhaarit karega.
isi tarah, ack rung sanrachana kaa upayog karke banaaya jaa sakata haih
sanrachana kaa rung {
 hastaaksharit naheen int laal;
 hastaaksharit naheen int green;
 hastaaksharit naheen int blue;
3dee graphics mein, aapako aamtaur parr pratyek sheersh kii sthiti aur rung donon kaa dhyaan rakhna chaahiye. aisaa karane kaa ack tarika yeh hoga kii pahale banaae gaye cocois _ 28 aur cocois _ 36 samagr prakaron kaa upayog karke ack cocois _ 34 samagr prakaar banaaya jaaeh
sanrachana sheersh {
 vector sthiti;
 rung;
tatkaal.
pahale key samaan praarup kaa upayog karke cocksey _ 37 prakaar kaa ack charr banaaenh cocksey _ 38
sadasya pahunch.
cocksey _ 39 key ghatakon koo iss tarah seey maan nirdhaarit karein -
vee.sthiti.x = 0.0;
vee.sthiti.y = 1.5;
vee.sthiti.z = 0.0;
vee.rung.laal = 128;
vee.rung.haraa = 0;
vee.rung.neela = 255;
adim upaprakaar.
cocksey _ 1 kaa praathamik upayog jatil detta prakaron key nirmaan key liye haye, lekin kabhi-kabhi iska upayog adim sanrachanaatmak upaprakaar banaane key liye kiya jaataa haye. udaaharan key liye, choonki maanak see key liye aavashyak haye kii yadi dou sanrachanaon mein samaan praarambhik kshetra hain, tou una kshetron koo usee tarah seey darshaaya jaayega, code
sanrachana iffoo _ old _ stub {
 lamba x, y;
sanrachana iffoo sanskaran _ 42 {
 lamba x, y, z;
 chaar * naam;
 lamba aeye, bee, see;
shoonya sanchaalan _ parr _ ifu (sanrachana ifu _ old _ stub *);
sanrachana iffoo _ sanskaran _ 42s;
operate _ onn _ ifu (& s);
sahee tareeke seey kaam karenge.
hastakshar type karein.
prakaar hastakshar (yaa kaary prakaar) kaa nirmaan adim aur samagr prakaron seey kiya jaataa haye, aur sanyukt prakaron kaa nirmaan karate samay swayam prakaar key roop mein kaam curr sakate hainh
typedeff sanrachana {
 int aiks;
 int vaaee;
} bindu;
typedeff double (* metrick) (bindu pee1, bindu pee2);
typedeff sanrachana {
 bindu kendra;
 dohri trijya;
 metrick metrick;
} vritt;