Q:

How are inline members of classes compiled?

I am new to c++ (and to programming itself) and this is what I heard:
If we compile an ordinary function, The compiler creates a pointer to that function and place the instructions that make up the body of the function elsewhere. This is how an ordinary function gets compiled. But in case of inline functions, the compiler generates code during compilation and replaces it with the inline function call. 
My question is when member functions (of a C++ class) are compiled, are they treated as inline functions or are they treated as ordinary functions?     

A:

They are just like normal functions, with one exception: if you write the function definition inside the class definition (example below), then the function is automatically given the inline keyword:

[C++11: 9.3/2]: A member function may be defined (8.4) in its class definition, in which case it is an inline member function (7.1.2), or it may be defined outside of its class definition if it has already been declared but not defined in its class definition.

struct T
{
   void foo()   // the same as `inline void foo()`
   {
      // ...
   }
};

That doesn't automatically mean the class will be inlined, though; the inline keyword is just a hint and is largely ignored nowadays when it comes to deciding whether to actually inline a function, though it does assuredly affect linkage.

A:

You asked:

are they treated as inline functions or are they treated as ordinary functions?

Member functions of classes can be inline or non-inline depending on how they are declared and defined.
Here's the relevant info from the standard:

9.3 Member functions
2 A member function may be defined (8.4) in its class definition, in which case it is an inline member function (7.1.2), or it may be defined outside of its class definition if it has already been declared but not defined in its class definition. A member function definition that appears outside of the class definition shall appear in a namespace scope enclosing the class definition...

Example:
class A
{
    A() : data(0) {} // Inline function

    inline A(A const& copy) : data(copy.data) {}
                            // Inline function. The keyword inline
                            // can be used but not necessary.
    int data;
};

3 An inline member function (whether static or non-static) may also be defined outside of its class definition provided either its declaration in the class definition or its definition outside of the class definition declares the function as inline. [ Note: Member functions of a class in namespace scope have external linkage. Member functions of a local class (9.8) have no linkage. See 3.5. —end note ]

Example:
class A
{
    A(); // Declaration doesn't say whether the function is inline or not.
    inline A(A const& copy); // Declaration says the function is inline.
    int data;
};

inline A::A() : data(0) {} // Implementation says the function is inline.

inline A(A const& copy) : data(copy.data) {}

4 There shall be at most one definition of a non-inline member function in a program; no diagnostic is required. There may be more than one inline member function definition in a program. See 3.2 and 7.1.2.

Example:
class A
{
    A(); // Declaration doesn't say whether the function is inline or not.
    inline A(A const& copy); // Declaration says the function is inline.
    int data;
};

inline A(A const& copy) : data(copy.data) {}
// Must be defined in a .h file since the declaration says the function is inline.

A::A() : data(0) {} // Non-inline implementation.
                    // It must be defined in only one translation unit (a .cpp file, not a .h file). 

