You are on page 1of 4

C & C++ 1. What is coercion? Ans: The Explicit type casting is also known as coercion 2.

What is the size o a character literal in C? Ans: 2 !yte ". What is the #se $g? Ans: it is a con%ersion char #se& to represent a loating point n#'!er either in &eci'al or'at or exponential or'at accor&ing to size. (. What is ellipsis? Ans: )*+ is known as ellipsis which represent a %aria!le no,s or types o arg#'ent. -. .ow 'any arg#'ents 'ain)+ #nction can take? Ans: " /. 'ain)+ #nction is pre&e ine& or #ser &e ine&? Ans: 0yste' speci ie& #ser &e ine& Arg#'ent %aria!le1 argc1 arg% 2. What hea&er iles contain? Ans: 3#nction &eclarations an& 4AC56 7. What is size o #nion %aria!le? Ans: 0ize o the 'ax size 'e'!er 8. What is a sel re erential str#ct#re? Ans: the str#ct#re which contains a pointer to itsel 19. Can a #nion !e sel :re erence&? Ans: ;o 11. What &oes seg'entation %iolation 'eans? Ans: This error occ#rs when progra' access a 'e'ory that it sho#l& not ha%e or to which access is not grante&. 12. What is the little en&ian an& !ig en&ian? Ans: <ittle en&ian 'eans the lower or&er !yte o a n#'!er is store& in 'e'ory at the lowest a&&ress an& the high or&er !ytes at the heighest a&&ress. =ig en&ian is re%erse. 1". What is the &i erence !etween exit)+ an& >exit)+ #nctions? Ans: exit)+ l#sh the stan&ar& ?@6 !# er !#t >exit)+ &oes not l#sh the stan&ar& ?@6 !# er. 1(. What is the &i erence !etween strcpy)+ an& 'e'cpy)+? Ans: strcpy copy chars or' one string to another till AB9, i.e. ;#ll char 4e'cpy copy chars ro' one string to another till a gi%en length. 1-. What is !it: iel&? Ans: The space:sa%ing str#ct#re 'e'!ers are calle& bit fields1 an& their wi&th in !its can !e explicitly &eclare&.

1/. What is ;C<< 'acro? An&: ;C<< is a 'acro that is #se& to represent n#ll pointer in so#rce co&e. 12. What is the &i erent !etween ar pointer an& h#ge pointer? Ans: 3ar pointer &oes not nor'alize the a&&ress !#t h#ge pointer nor'alize the a&&ress. 17. What is e ect o #sing $n in scan ? Ans: it represent the the no o char e inp#t ro' ley!oar&. 18. Di erence !etween expression an& a state'ent. 0tate'ent '#st ha%e a se'icolon !#t expression 'ay not ha%e se'icolon. 29. What is loop in%ersion? Ans: <oop in%ersion is a co'piler opti'ization1 a loop trans or'ation1 which replaces a while loop !y an i !lock containing a &o..while loop. 21. What is si&e e ect o a %aria!le? Ans: The changes to a glo!al %aria!le in one !lock will !e an e ect in another !lock. 22. What are the li'itations o !it iel&s? Ans: We can not inp#t its %al#es #sing scan We can not ha%e a pointer to !it iel& 2". What the #se o %olatile keywor&?

Ans: CEs %olatile keywor& is a F#ali ier that is applie& to a %aria!le when it is &eclare&. ?t
tells the co'piler that the %al#e o the %aria!le 'ay !e change& !y an external agent like operation syste' s#! ro#tines.

2(. int aG-1!G2H aIG!IGaIG!H print )J$& $&K1a1!+H Ans: 2 2-. int aG91!G91cG91&H &Ga++ LL !++ && ++cH print )M$& $& $& $&M1 a1 !1 c1&+H Ans: 1 1 9 9 2/. N&e ine scan J$s is stringK 'ain)+ O print )scan 1scan +H P Ans: $ is string is string 22. int xG91yG91zH zGQx+QyH print )M$&M1z+H Ans: :2 27. int 'ain)+ O

int xH xG'ain)+H print )J$&K1x+H ret#rn 9H P Ans: in inite loop 28. int arrR SGO911121"1(PH int Tp1iH or)pGarr+(1 iG9HiUG(Hi+++ print )J$& J1 pR:iS+H Ans: ( " 2 1 9 "9. 'ain)+ O int iG9H or)H++ i H+H print )J$&K1i +H P Ans: 9 "1. What is wchat>t in C++? Ans: Wi&e character type "2. What is na'e 'angling? Ans: Con%ersion o a #nction na'e into a co&e accor&ing to nos an& types o arg#'ent. "". What is VTA=<E? Ans: Virt#al Ta!le which stores the a&&resses o %irt#al #nctions o a class "(. What is VWT5? Ans: Virt#al pointer thro#gh which %irt#al #nctions are accesse& "-. What is 5TT?? Ans: 5#nti'e type i&enti ication "/. What is reinterpret cast? Ans: ?t con%ert one type &irectly into another : s#ch as casting the integer %al#e to an integer pointer. "2. What is Co'position? Ans: The containership or &elegation is also known as co'position "7. What is o!Xect slicing? Ans: When a &eri%e& class o!Xect is assigne& to a !ase class o!Xect it is &i%i&e& into two parts. 6ne is !ase portion that is copie& to the !ase class o!Xect an& other is the &eri%e& portion that is slices o . "8. What is #pcasting? Ans: con%ersion o a &eri%e& class o!Xect to a !ase class o!Xect (9. Can p#re %irt#al #nction ha%e a !o&y? Ans: Yes

(1. What is the #se o explicit keywor&? AnsH to explicitly call a constr#ctor. (2. What is the #se o '#ta!le keywor&? Ans: ? a &ata 'e'!er is &eclare& with '#ta!le that can !e 'o&i ie& !y a constant 'e'!er #nction. (". What is a pointer to constant? Ans: ?t is a pointer to who' it points to can not !e 'o&i ie& ((. What is the size o an o!Xect o e'pty class? Ans: one !yte (-. Which operator a#to'atically calls the &estr#ctor? Ans: &elete

TTT

You might also like