NOTE: If you don't want any of the answers spoilt, then answer them in a notepad or something before scrolling through the replies.
Q 000) What's the difference between 'char* = "blah"' and 'char[] = "blah"'?
Q 001) What does koenig look-up allow us to do?
Q 002) Give an example of partial ordering of function templates.
Q 003) What is placement new?
Q 004) When is placement delete used?
Q 005) What's the maximum value x can contain?
unsigned int x:5;
Q 006) What will the following display?
short x = -32768;
short y = -x;
if( x != y ) std::cout << "!="<< std::endl;
else std::cout<< "=="<< std::endl;
Q 007) When does the following evaluate to true?
if( x == x == x )
Q 008) When does the following evaluate to true?
if( x != x != x )
Q 009) What will be the value of x?
int x = 2;
x += x++;
Q 010) What does the follwoing print?
std::cout<< ( 4 >= 3 >= 2 )<< std::endl;
std::cout<< ( 2 >= 1 >= 0 )<< std::endl;
Q 011) How do you invoke the ctor and dtor explicitly?
Q 012) Will std::vector always have contigious memory?
Q 013) What is template specialization and partial specialization?
Q 014) Rewrite the following function so that the following conditions are satisfied:
A) the multiplication operator ('*') is not used.
:) the division operator ('/') is not used.
C) the function does not make use of loops.
D) And no using assembly either
int MultiplyBy321(int val)
{
int res;
res = val * 321;
return res;
}
Q 015) Determine if a given type T is const or not at compile time.
Q 016) What is the purpose of inheritance?
Q 017) How would you load a text file on disk into memory?
Q 018) What does the following macro do?
#define macro(x, y) (int)(&((x*)0)->y)
REMEMBER: DO NOT scroll past this point if you dont want to see the answers to some questions.













