When is a template better solution than a base class??
Answer Posted / faruk
1.when you are designing a generic class to contain or otherwise manage objects of other types.
2.when the format and behaviour of those other types are unimportant to their containment or management.
3.particularly when those other types are unknown.
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
What is operators in c++?
Define a pdb file.
how can i access a direct (absolute, not the offset) memory
address?
here is what i tried:
wrote a program that ask's for an address from the user,
creates a FAR pointer to that adress and shows it. then the
user can increment/decrement the value in that address by
pressing p(inc+) and m(dec-).
NOW, i compiled that program and opened it twice (in 2
different windows) and gave twice the same address to it.
now look what happen - if i change the value in
one "window" of the program, it DOES NOT change in the
other! even if they point to the same address in the memory!
here is the code snippet:
//------------------------------------------------------
#include How can you prevent accessing of the private parts of my class by other programmers (violating encapsulation)? What is the difference between prefix and postfix versions of operator++()? Which ide is best for c++? Is c++ free? In int main(int argc, char *argv[]) what is argv[0]
a) The first argument passed into the program
b) The program name
c) You can't define main like that What is the use of bit fields in structure declaration? Which is not a valid keyword
a) public
b) protected
c) guarded Explain dangling pointer. Carry out conversion of one object of user-defined type to another? What is c++ array? What does the linker do? What is the object serialization?