Visit our sponsor Five Planet Juices  
Home
Microsoft Interview Process
Microsoft HR Questions
Technical Questions
Puzzles/Riddles
Resume Tips and Template
Discuss
Question to Interviewer
Interview Tips
Term Of Use
Site Feedback


What are inline fns? What are their advantages? How are they declared?

An inline function is a function which gets textually inserted by the compiler, much like a macro. Like macros, performance is improved by avoiding the overhead of the call itself, and (especially!) by the compiler being able to optimize *through* the call (`procedural integration'). Unlike macros, arguments to inline fns are always evaluated exactly once, so the `call' is semantically like a regular function call only faster. Also unlike macros, argument types are checked and necessary conversions are performed correctly.

Beware that overuse of inline functions can cause code bloat, which can in turn have a negative performance impact in paging environments.

class X {
public:
void f(int i, char c) { /*...*/ } //inline function within a class
};
or by defining the member function as `inline' outside the class:
class X {
public:
void f(int i, char c);
};
//...
inline void X::f(int i, char c) {/*...*/} //inline fn outside the class

 

Generally speaking, a function cannot be defined as `inline' after it has been called. Inline functions should be defined in a header file, with `outlined' functions appearing in a `.C' file (or .cpp, etc; see question on file naming conventions).


 

Add Your Comment

New Articles
  • Phone screen from MICROSOFT Denmark for SDET
    Technical Phone screen after Escreen

  • Please post some non-tech qs for User Experience and Business Analyst job

    I am a CS Grad applied in non-tech position.Please help!


  • Combinations in a character array.
    Write a program that takes input a char array and outputs all the combinations of the characters in the character array.
    Example: consier char array {'a','b','c'}
    the output shouold be abc,cab,bac,acb,cba,bca that is all the combinations of characters 'a','b','c'.


  •  

    Most Popular Articles
  • Crazy Guy On The Airplane
    A line of 100 airline passengers is waiting to board a plane. they each hold a ticket to one of the 100 seats on that flight.

  • What are your greatest weaknesses
    Beware - this is an eliminator question, designed to shorten the candidate list. Any admission of a weakness or fault will earn you an “A” for honesty, but an “F” for the interview.

  • Question: Tell me about yourself.
    Many candidates, unprepared for the question, skewer themselves by rambling, recapping their life story, delving into ancient work history or personal matters.

  •  

    New Posts

  • male enhancment buy viagra tramadol online
    Posted by SurojattSit on 2008年9月30日 (UMST)

  • penis enlargement viagra cheap tramadol
    Posted by BobeCrobChext on 2008年9月30日 (UMST)

  • penis viagra online Tramadol
    Posted by BobeCrobChext on 2008年9月30日 (UMST)



  •